/* =========================================================
   SMART GLOBAL INVENTORY SEARCH
   File: assets/css/smart-search.css

   Scope:
   - /inventory/search and /smart-search only
   - Does not change navbar, sidebar or existing stock module CSS
   ========================================================= */

.smart-search-page {
  --smart-blue: #2563eb;
  --smart-blue-dark: #1d4ed8;
  --smart-blue-soft: #eff6ff;
  --smart-green: #16a34a;
  --smart-green-soft: #dcfce7;
  --smart-orange: #f97316;
  --smart-orange-soft: #fff7ed;
  --smart-purple: #7c3aed;
  --smart-purple-soft: #f5f3ff;
  --smart-red: #ef4444;
  --smart-red-soft: #fef2f2;
  --smart-slate: #0f172a;
  --smart-muted: #64748b;
  --smart-border: #e2e8f0;
  --smart-surface: #ffffff;
  --smart-bg: #f8fafc;
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.10), transparent 28rem),
    linear-gradient(180deg, #ffffff 0%, #f8fafc 44%, #f8fafc 100%);
  color: var(--smart-slate);
  min-height: calc(100vh - 78px);
  padding: 24px 28px 32px;
}

.smart-search-page * {
  box-sizing: border-box;
}

.smart-page-header,
.smart-search-hero,
.smart-kpi-card,
.smart-product-card,
.smart-stock-card,
.smart-results-panel,
.smart-side-card,
.smart-empty-state {
  border: 1px solid rgba(226, 232, 240, 0.9);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.06);
}

.smart-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  padding: 18px 20px;
  border-radius: 22px;
}

.smart-page-header h1 {
  margin: 0;
  color: #06133d;
  font-size: 28px;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.smart-page-header p {
  margin: 6px 0 0;
  color: #475569;
  font-size: 14px;
  font-weight: 700;
}

.smart-header-actions,
.smart-result-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.smart-primary-btn,
.smart-secondary-btn,
.smart-view-btn {
  border: 1px solid transparent;
  border-radius: 14px;
  height: 42px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.smart-primary-btn {
  color: #ffffff;
  background: linear-gradient(135deg, var(--smart-blue), #0f5bf3);
  box-shadow: 0 16px 30px rgba(37, 99, 235, 0.22);
}

.smart-primary-btn:hover,
.smart-view-btn:hover,
.smart-secondary-btn:hover {
  transform: translateY(-1px);
}

.smart-primary-btn:disabled {
  cursor: not-allowed;
  opacity: 0.75;
  transform: none;
}

.smart-secondary-btn,
.smart-view-btn {
  color: #0f172a;
  background: #ffffff;
  border-color: #dbe4f0;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

.smart-view-btn {
  height: 36px;
  padding: 0 14px;
  color: var(--smart-blue);
  border-color: #bfdbfe;
  background: #eff6ff;
}

.smart-search-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 16px;
  align-items: start;
}

.smart-search-main {
  min-width: 0;
  display: grid;
  gap: 16px;
}

.smart-search-sidebar {
  min-width: 0;
  display: grid;
  gap: 14px;
  position: sticky;
  top: 16px;
}

.smart-search-hero {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 26px;
  align-items: center;
  padding: 26px;
  border-radius: 26px;
  overflow: hidden;
  position: relative;
}

.smart-search-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 13% 16%, rgba(37, 99, 235, 0.10), transparent 18rem),
    radial-gradient(circle at 92% 8%, rgba(124, 58, 237, 0.08), transparent 17rem);
}

.smart-barcode-card,
.smart-search-workspace {
  position: relative;
  z-index: 1;
}

.smart-barcode-card {
  min-height: 238px;
  border: 1px solid #e5ecf8;
  border-radius: 18px;
  background: linear-gradient(180deg, #f8fbff 0%, #eef5ff 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.smart-barcode-visual {
  width: 164px;
  height: 118px;
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 5px;
  position: relative;
}

.smart-barcode-visual span {
  display: block;
  width: 5px;
  border-radius: 8px;
  background: #081333;
  opacity: 0.95;
}

.smart-barcode-visual span:nth-child(2),
.smart-barcode-visual span:nth-child(5),
.smart-barcode-visual span:nth-child(9) { width: 9px; }
.smart-barcode-visual span:nth-child(4),
.smart-barcode-visual span:nth-child(8) { width: 3px; }
.smart-barcode-visual span:nth-child(6) { width: 12px; }

.smart-barcode-visual em {
  position: absolute;
  left: -10px;
  right: -10px;
  top: 50%;
  height: 4px;
  border-radius: 99px;
  background: linear-gradient(90deg, transparent, #ef4444, #fb7185, #ef4444, transparent);
  box-shadow: 0 0 22px rgba(239, 68, 68, 0.7);
  animation: smartScanLine 2.2s ease-in-out infinite;
}

@keyframes smartScanLine {
  0%, 100% { transform: translateY(-36px); opacity: 0.55; }
  50% { transform: translateY(36px); opacity: 1; }
}

.smart-barcode-card strong {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: 999px;
  color: #15803d;
  background: #dcfce7;
  font-size: 12px;
  font-weight: 900;
}

.smart-barcode-card strong i {
  font-size: 9px;
}

.smart-eyebrow {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 7px 11px;
  border-radius: 999px;
  color: var(--smart-blue-dark);
  background: #eff6ff;
  border: 1px solid #dbeafe;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.smart-search-workspace h2 {
  margin: 14px 0 8px;
  color: #06133d;
  font-size: 24px;
  line-height: 1.2;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.smart-search-workspace p {
  margin: 0;
  max-width: 760px;
  color: #475569;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.7;
}

.smart-search-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-top: 22px;
}

.smart-search-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
}

.smart-search-input-wrap i {
  position: absolute;
  left: 17px;
  color: #64748b;
  font-size: 15px;
  z-index: 1;
}

.smart-search-input-wrap input {
  width: 100%;
  height: 52px;
  border-radius: 16px;
  border: 1px solid #dbe4f0;
  background: #ffffff;
  color: #07163f;
  outline: none;
  padding: 0 18px 0 46px;
  font-size: 14px;
  font-weight: 800;
  box-shadow: 0 13px 28px rgba(15, 23, 42, 0.05);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.smart-search-input-wrap input:focus {
  border-color: rgba(37, 99, 235, 0.55);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.10), 0 14px 30px rgba(15, 23, 42, 0.06);
}

.smart-search-form .smart-primary-btn {
  height: 52px;
  min-width: 132px;
  border-radius: 16px;
}

.smart-info-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 14px;
  color: #1e3a8a;
  background: rgba(239, 246, 255, 0.92);
  border: 1px solid #dbeafe;
  font-size: 13px;
  font-weight: 800;
}

.smart-info-strip i {
  color: var(--smart-blue);
}

.smart-kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.smart-kpi-card {
  min-height: 118px;
  border-radius: 20px;
  padding: 16px;
  display: grid;
  gap: 8px;
  position: relative;
  overflow: hidden;
}

.smart-kpi-card::after {
  content: "";
  position: absolute;
  right: -32px;
  bottom: -40px;
  width: 108px;
  height: 108px;
  border-radius: 999px;
  opacity: 0.42;
}

.smart-kpi-card.blue::after,
.smart-kpi-card.product::after { background: #dbeafe; }
.smart-kpi-card.green::after { background: #bbf7d0; }
.smart-kpi-card.orange::after { background: #fed7aa; }
.smart-kpi-card.purple::after { background: #ddd6fe; }

.smart-kpi-icon {
  width: 38px;
  height: 38px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 15px;
  color: #ffffff;
  background: var(--smart-blue);
  box-shadow: 0 13px 22px rgba(37, 99, 235, 0.18);
}

.smart-kpi-card.green .smart-kpi-icon { background: var(--smart-green); box-shadow: 0 13px 22px rgba(22, 163, 74, 0.16); }
.smart-kpi-card.orange .smart-kpi-icon { background: var(--smart-orange); box-shadow: 0 13px 22px rgba(249, 115, 22, 0.16); }
.smart-kpi-card.purple .smart-kpi-icon { background: var(--smart-purple); box-shadow: 0 13px 22px rgba(124, 58, 237, 0.16); }

.smart-kpi-card span {
  color: #64748b;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.smart-kpi-card strong {
  color: #07163f;
  font-size: 28px;
  font-weight: 950;
  letter-spacing: -0.04em;
  line-height: 1;
  position: relative;
  z-index: 1;
}

.smart-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.35fr);
  gap: 14px;
}

.smart-product-card,
.smart-stock-card,
.smart-results-panel,
.smart-side-card,
.smart-empty-state {
  border-radius: 22px;
}

.smart-product-card,
.smart-stock-card {
  padding: 18px;
}

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

.smart-section-head h2,
.smart-side-card h3 {
  margin: 0;
  color: #07163f;
  font-size: 17px;
  font-weight: 950;
  letter-spacing: -0.03em;
}

.smart-section-head p {
  margin: 4px 0 0;
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.smart-section-head.compact {
  margin-bottom: 14px;
}

.smart-product-layout {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.smart-product-image {
  min-height: 154px;
  border-radius: 18px;
  border: 1px solid #e2e8f0;
  background: linear-gradient(180deg, #f8fafc, #eef4ff);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.smart-product-image img,
.smart-table-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.smart-product-fallback {
  width: 82px;
  height: 82px;
  border-radius: 24px;
  display: grid;
  place-items: center;
  color: var(--smart-blue);
  background: #dbeafe;
  font-size: 34px;
}

.smart-product-fallback.small {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  font-size: 15px;
}

.smart-product-title-line {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.smart-product-title-line h3 {
  margin: 0;
  color: #07163f;
  font-size: 19px;
  font-weight: 950;
  letter-spacing: -0.04em;
}

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

.smart-product-field {
  min-width: 0;
}

.smart-product-field span {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #64748b;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.smart-product-field span i {
  color: var(--smart-blue);
}

.smart-product-field strong {
  display: block;
  margin-top: 5px;
  color: #07163f;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.smart-stock-mini {
  min-height: 124px;
  border-radius: 18px;
  padding: 15px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  display: grid;
  gap: 8px;
}

.smart-stock-mini.blue { background: #eff6ff; border-color: #dbeafe; }
.smart-stock-mini.green { background: #f0fdf4; border-color: #dcfce7; }
.smart-stock-mini.orange { background: #fff7ed; border-color: #ffedd5; }
.smart-stock-mini.red { background: #fef2f2; border-color: #fee2e2; }

.smart-stock-mini span {
  width: 34px;
  height: 34px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  color: var(--smart-blue);
  background: #dbeafe;
}
.smart-stock-mini.green span { color: var(--smart-green); background: #dcfce7; }
.smart-stock-mini.orange span { color: var(--smart-orange); background: #ffedd5; }
.smart-stock-mini.red span { color: var(--smart-red); background: #fee2e2; }

.smart-stock-mini small {
  color: #64748b;
  font-size: 12px;
  font-weight: 900;
}

.smart-stock-mini strong {
  color: #07163f;
  font-size: 22px;
  font-weight: 950;
  letter-spacing: -0.04em;
}

.smart-stock-mini em {
  color: #64748b;
  font-size: 11px;
  font-weight: 850;
  font-style: normal;
}

.smart-warehouse-line {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #edf2f7;
}

.smart-warehouse-line span {
  color: #64748b;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.smart-warehouse-line strong {
  display: block;
  margin-top: 4px;
  color: #07163f;
  font-size: 13px;
  font-weight: 900;
}

.smart-empty-state {
  min-height: 260px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 10px;
}

.smart-empty-icon {
  width: 72px;
  height: 72px;
  border-radius: 24px;
  display: grid;
  place-items: center;
  color: var(--smart-blue);
  background: #eff6ff;
  border: 1px solid #dbeafe;
  font-size: 26px;
}

.smart-empty-state h2 {
  margin: 0;
  color: #07163f;
  font-size: 20px;
  font-weight: 950;
  letter-spacing: -0.04em;
}

.smart-empty-state p {
  margin: 0;
  max-width: 480px;
  color: #64748b;
  font-size: 14px;
  font-weight: 750;
  line-height: 1.6;
}

.smart-results-panel {
  overflow: hidden;
}

.smart-results-panel .smart-section-head {
  padding: 17px 18px;
  border-bottom: 1px solid #e2e8f0;
}

.smart-result-tools span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  color: #475569;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  font-size: 12px;
  font-weight: 900;
}

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

.smart-results-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 980px;
}

.smart-results-table th {
  padding: 13px 16px;
  color: #334155;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  font-size: 11px;
  font-weight: 950;
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0.055em;
  white-space: nowrap;
}

.smart-results-table td {
  padding: 13px 16px;
  border-bottom: 1px solid #edf2f7;
  color: #0f172a;
  font-size: 13px;
  font-weight: 800;
  vertical-align: middle;
}

.smart-results-table tbody tr {
  transition: background 0.16s ease;
}

.smart-results-table tbody tr:hover {
  background: #f8fbff;
}

.smart-results-table td strong {
  display: block;
  color: #07163f;
  font-size: 13px;
  font-weight: 950;
}

.smart-results-table td small {
  display: block;
  margin-top: 4px;
  color: #64748b;
  font-size: 11px;
  font-weight: 750;
}

.smart-results-table code {
  display: inline-flex;
  align-items: center;
  max-width: 210px;
  padding: 6px 8px;
  border-radius: 10px;
  color: #1e293b;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  font-family: inherit;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.smart-table-thumb {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.smart-type-badge,
.smart-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 11px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 950;
  white-space: nowrap;
}

.smart-type-badge.product { color: #1d4ed8; background: #dbeafe; }
.smart-type-badge.serial { color: #15803d; background: #dcfce7; }
.smart-type-badge.batch { color: #c2410c; background: #ffedd5; }
.smart-type-badge.barcode { color: #6d28d9; background: #ede9fe; }
.smart-type-badge.search { color: #475569; background: #f1f5f9; }

.smart-status-badge.success { color: #15803d; background: #dcfce7; }
.smart-status-badge.warning { color: #c2410c; background: #ffedd5; }
.smart-status-badge.danger { color: #dc2626; background: #fee2e2; }
.smart-status-badge.muted { color: #475569; background: #f1f5f9; }

.smart-table-empty {
  height: 148px;
  text-align: center;
  color: #64748b !important;
  font-size: 14px !important;
  font-weight: 850 !important;
}

.smart-inline-loader {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-right: 10px;
  vertical-align: middle;
}

.smart-inline-loader span {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--smart-blue);
  animation: smartDot 0.9s ease-in-out infinite;
}

.smart-inline-loader span:nth-child(2) { animation-delay: 0.12s; }
.smart-inline-loader span:nth-child(3) { animation-delay: 0.24s; }

@keyframes smartDot {
  0%, 100% { opacity: 0.35; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-4px); }
}

.smart-side-card {
  padding: 16px;
}

.smart-side-head {
  margin-bottom: 12px;
}

.smart-side-head h3,
.smart-side-card h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
}

.smart-side-head h3 i,
.smart-side-card h3 i {
  color: var(--smart-blue);
}

.smart-side-head button {
  border: 0;
  background: transparent;
  color: var(--smart-blue);
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.smart-history-item {
  width: 100%;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 58px;
  padding: 8px 0;
  border: 0;
  border-bottom: 1px solid #edf2f7;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.smart-history-item:last-child {
  border-bottom: 0;
}

.smart-history-icon {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: var(--smart-blue);
  background: #eff6ff;
}

.smart-history-item strong,
.smart-history-item small {
  display: block;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.smart-history-item strong {
  color: #07163f;
  font-size: 12px;
  font-weight: 950;
}

.smart-history-item small {
  margin-top: 3px;
  color: #64748b;
  font-size: 11px;
  font-weight: 750;
}

.smart-history-item em {
  color: #64748b;
  font-size: 10px;
  font-weight: 850;
  font-style: normal;
  white-space: nowrap;
}

.smart-history-item .smart-type-badge {
  grid-column: 2 / 4;
  width: fit-content;
  min-height: 22px;
  padding: 0 8px;
  font-size: 10px;
}

.smart-mini-empty {
  min-height: 92px;
  display: grid;
  place-items: center;
  gap: 8px;
  color: #64748b;
  text-align: center;
  font-size: 12px;
  font-weight: 850;
}

.smart-mini-empty i {
  font-size: 22px;
  color: #94a3b8;
}

.smart-side-card.tips ul {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.smart-side-card.tips li {
  position: relative;
  padding-left: 18px;
  color: #475569;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.55;
}

.smart-side-card.tips li::before {
  content: "";
  position: absolute;
  top: 7px;
  left: 0;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--smart-blue);
}

.smart-search-page.is-loading .smart-search-input-wrap input {
  background-image: linear-gradient(90deg, #ffffff 0%, #f8fbff 48%, #ffffff 100%);
  background-size: 220% 100%;
  animation: smartInputGlow 1.2s linear infinite;
}

@keyframes smartInputGlow {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

.text-right {
  text-align: right !important;
}

@media (max-width: 1400px) {
  .smart-search-shell {
    grid-template-columns: minmax(0, 1fr) 300px;
  }
  .smart-stock-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1180px) {
  .smart-search-shell,
  .smart-search-hero,
  .smart-detail-grid {
    grid-template-columns: 1fr;
  }
  .smart-search-sidebar {
    position: static;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .smart-kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .smart-barcode-card {
    min-height: 190px;
  }
}

@media (max-width: 860px) {
  .smart-search-page {
    padding: 16px;
  }
  .smart-page-header {
    align-items: stretch;
    flex-direction: column;
  }
  .smart-header-actions,
  .smart-search-form,
  .smart-product-layout,
  .smart-product-fields,
  .smart-warehouse-line,
  .smart-search-sidebar {
    grid-template-columns: 1fr;
  }
  .smart-header-actions {
    display: grid;
  }
  .smart-kpi-grid,
  .smart-stock-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .smart-search-hero {
    padding: 18px;
  }
}

@media (max-width: 560px) {
  .smart-kpi-grid,
  .smart-stock-grid {
    grid-template-columns: 1fr;
  }
  .smart-page-header h1 {
    font-size: 24px;
  }
  .smart-search-workspace h2 {
    font-size: 21px;
  }
}

/* ==================== SMART SEARCH V2: IMEI + TRANSACTIONS ==================== */
.smart-kpi-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.smart-kpi-card.slate::after { background: #e2e8f0; }
.smart-kpi-card.slate .smart-kpi-icon {
  background: #334155;
  box-shadow: 0 13px 22px rgba(51, 65, 85, 0.16);
}

.smart-type-badge.imei { color: #0369a1; background: #e0f2fe; }
.smart-type-badge.sale { color: #047857; background: #d1fae5; }
.smart-type-badge.purchase { color: #1d4ed8; background: #dbeafe; }
.smart-type-badge.payment { color: #7c2d12; background: #ffedd5; }
.smart-type-badge.return { color: #b45309; background: #fef3c7; }
.smart-type-badge.expense { color: #c2410c; background: #ffedd5; }
.smart-type-badge.online-order { color: #6d28d9; background: #ede9fe; }
.smart-type-badge.transaction { color: #334155; background: #e2e8f0; }

.smart-transaction-thumb {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: var(--smart-blue);
  background: #eff6ff;
  border: 1px solid #dbeafe;
  font-size: 14px;
}

.smart-record-preview {
  border: 1px solid rgba(226, 232, 240, 0.92);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.06);
  border-radius: 22px;
  padding: 22px;
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.smart-record-preview-icon {
  width: 76px;
  height: 76px;
  border-radius: 24px;
  display: grid;
  place-items: center;
  color: #ffffff;
  background: linear-gradient(135deg, var(--smart-blue), #0f5bf3);
  box-shadow: 0 18px 36px rgba(37, 99, 235, 0.22);
  font-size: 26px;
}

.smart-record-preview.transaction .smart-record-preview-icon {
  background: linear-gradient(135deg, #334155, #0f172a);
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.18);
}

.smart-record-preview-body {
  min-width: 0;
}

.smart-record-preview-body h2 {
  margin: 14px 0 6px;
  color: #07163f;
  font-size: 22px;
  line-height: 1.2;
  font-weight: 950;
  letter-spacing: -0.04em;
}

.smart-record-preview-body p {
  margin: 0;
  color: #64748b;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.6;
}

.smart-record-meta-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px 16px;
  margin: 18px 0;
}

.smart-record-meta-grid .smart-product-field {
  min-height: 64px;
  padding: 12px;
  border: 1px solid #edf2f7;
  border-radius: 14px;
  background: #f8fafc;
}

.smart-record-meta-grid .smart-product-field strong {
  font-size: 13px;
}

.smart-results-table .smart-view-btn[data-open-route=""] {
  opacity: 0.55;
  pointer-events: none;
}

@media (max-width: 1480px) {
  .smart-kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .smart-record-preview,
  .smart-record-meta-grid {
    grid-template-columns: 1fr;
  }
  .smart-record-preview-icon {
    width: 64px;
    height: 64px;
    border-radius: 20px;
  }
}
