/* =========================================================
   ENHANCEMENTS.CSS — Cross-cutting UI upgrades
   Added: 2026-06-08

   Contains:
   - Display typography (Satoshi headings)
   - Page entrance animations
   - Sticky table headers
   - Table skeleton loading
   - Toast notification animations
   - Empty state illustration styles
   - Stage progress bar component
   - Dashboard greeting component
   - Quick-action button bar
   - Column visibility toggle
   - Table density toggle
   ========================================================= */

/* =========================
   1. DISPLAY TYPOGRAPHY
   Satoshi for headings — adds character while keeping
   Inter for body text continuity.
   ========================= */

/* Satoshi is loaded as a non-blocking <link> in base.html — @import removed (was render-blocking). */

:root {
  --font-display: 'Satoshi', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Apply display font to major headings */
.dashboard-page__title,
.orders-page__title,
.inquiry-create-page__title,
.admin-page-title,
.profile-section-title,
.ic-page__title,
h1,
.job-detail-layout__header h1,
.table-card__title,
.panel-card__title,
.metric-card__label,
.login-title,
.cmodal__title,
.smodal__title {
  font-family: var(--font-display);
}

/* =========================
   2. PAGE ENTRANCE ANIMATIONS
   Smooth fade-up on page load
   ========================= */

@keyframes pageEnter {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(16px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Page content entrance — opt-in only (data-animate="enter") to prevent re-trigger on dynamic inserts */
[data-animate="enter"] {
  animation: pageEnter 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Stagger sections within dashboard */
.dashboard-page__kpis       { animation-delay: 0.02s; }
.dashboard-page__live-table  { animation-delay: 0.08s; }
.dashboard-page__orders      { animation-delay: 0.14s; }
.dashboard-page__lower-grid  { animation-delay: 0.20s; }

/* Stagger sections within job detail */
.job-detail-layout__header          { animation: slideUp 0.3s ease-out both; animation-delay: 0.02s; }
.job-detail-layout__section:nth-child(2) { animation: slideUp 0.3s ease-out both; animation-delay: 0.06s; }
.job-detail-layout__section:nth-child(3) { animation: slideUp 0.3s ease-out both; animation-delay: 0.10s; }
.job-detail-layout__section:nth-child(4) { animation: slideUp 0.3s ease-out both; animation-delay: 0.14s; }

/* =========================
   3. STICKY TABLE HEADERS
   Works on all table pages
   ========================= */

.orders-table thead,
.customer-table thead,
.supplier-table thead {
  position: sticky;
  top: 0;
  z-index: 10;
}

.orders-table thead th,
.customer-table thead th,
.supplier-table thead th {
  background: var(--table-header-bg);
  backdrop-filter: blur(8px);
  border-bottom: 2px solid var(--border-light);
}

.orders-table .col-ins {
  width: 100px;
  min-width: 100px;
  max-width: 110px;
}

/* Ensure the scroll container allows sticky to work */
.orders-table-wrap,
.customer-table-wrap,
.supplier-table-wrap {
  max-height: calc(100vh - 320px);
  overflow-y: auto;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border-default) transparent;
}

/* =========================
   4. TABLE SKELETON LOADING
   Animated placeholder rows
   ========================= */

.table-skeleton-row td {
  padding: 14px 12px;
}

.table-skeleton-cell {
  height: 14px;
  border-radius: 6px;
  background: var(--surface-2);
  animation: skeleton-pulse 1.4s ease-in-out infinite;
}

.table-skeleton-cell--short { width: 60%; }
.table-skeleton-cell--medium { width: 80%; }
.table-skeleton-cell--long { width: 95%; }

.table-skeleton-row:nth-child(2) .table-skeleton-cell { animation-delay: 0.1s; }
.table-skeleton-row:nth-child(3) .table-skeleton-cell { animation-delay: 0.2s; }
.table-skeleton-row:nth-child(4) .table-skeleton-cell { animation-delay: 0.3s; }
.table-skeleton-row:nth-child(5) .table-skeleton-cell { animation-delay: 0.4s; }

/* =========================
   5. TOAST NOTIFICATION ANIMATIONS
   ========================= */

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateX(100%) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes toastSlideOut {
  from {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateX(100%) scale(0.95);
  }
}

.global-toast-root > .toast {
  animation: toastSlideIn 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.global-toast-root > .toast.is-leaving {
  animation: toastSlideOut 0.25s ease-in both;
}

/* =========================
   6. EMPTY STATE ILLUSTRATIONS
   SVG-based decorative backgrounds
   ========================= */

.empty-state-illustration {
  width: 120px;
  height: 120px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.empty-state-illustration::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, var(--brand-soft), transparent 70%);
  opacity: 0.6;
}

.empty-state-illustration i {
  font-size: 40px;
  color: var(--text-dim);
  position: relative;
  z-index: 1;
}

/* (Section 7: Stage progress bar — removed, stages are dynamic per CRM config) */

/* =========================
   8. DASHBOARD GREETING
   ========================= */

.dashboard-greeting {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  padding: 20px 24px;
  background: var(--surface-card);
  border: 1px solid var(--border-soft);
  border-radius: 18px;
  box-shadow: var(--shadow-sm);
  animation: slideUp 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.dashboard-greeting__left {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.dashboard-greeting__avatar {
  width: 48px;
  height: 48px;
  min-width: 48px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 800;
  font-family: var(--font-display);
}

.dashboard-greeting__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.dashboard-greeting__text h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  color: var(--text-main);
  font-family: var(--font-display);
  line-height: 1.2;
}

.dashboard-greeting__text p {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}

.dashboard-greeting__text .greeting-date {
  font-variant-numeric: tabular-nums;
}

.dashboard-greeting__right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* =========================
   9. QUICK ACTION BUTTONS
   Dashboard header buttons
   ========================= */

.quick-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* .quick-action-btn — now an alias of .btn.btn-secondary (H-04 fix).
   Kept for backward compat with existing templates; do not use in new code.
   New code: use <button class="btn btn-secondary"> instead. */
.quick-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 14px;
  height: 36px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  background: var(--surface-card);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 80ms ease;
  white-space: nowrap;
}

.quick-action-btn:hover {
  background: var(--surface-2);
  border-color: var(--border-default);
  color: var(--text-primary);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.quick-action-btn i {
  font-size: 12px;
}

/* (Sections 10-11: Column toggle & density toggle — removed) */

/* =========================
   12. STICKY JOB DETAIL HEADER
   ========================= */

.job-detail-layout__header--sticky {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--surface-page) 82%, transparent);
  padding-bottom: 16px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border-soft);
  backdrop-filter: blur(12px);
}

.job-detail-layout__header--sticky::after {
  content: '';
  position: absolute;
  bottom: -12px;
  left: 0;
  right: 0;
  height: 12px;
  background: linear-gradient(180deg, var(--surface-page), transparent);
  pointer-events: none;
}

/* =========================
   13. ROW HOVER PREVIEW
   Shows mini summary card on hover
   ========================= */

.row-preview {
  display: none;
  position: absolute;
  right: 100%;
  top: 50%;
  transform: translateY(-50%);
  margin-right: 12px;
  min-width: 260px;
  max-width: 320px;
  padding: 14px 16px;
  background: var(--surface-card);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  z-index: 40;
  pointer-events: none;
  animation: fade-in 0.15s ease-out;
}

tr:hover .row-preview {
  display: block;
}

.row-preview__title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.row-preview__row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 3px 0;
  font-size: 12px;
}

.row-preview__label {
  color: var(--text-muted);
  font-weight: 600;
}

.row-preview__value {
  color: var(--text-secondary);
  font-weight: 700;
  text-align: right;
}

/* =========================
   14. RESPONSIVE ADJUSTMENTS
   ========================= */

@media (max-width: 768px) {
  .dashboard-greeting {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 18px;
  }

  .dashboard-greeting__right {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .quick-actions {
    flex-wrap: nowrap;
  }

}

@media (max-width: 639px) {
  .dashboard-greeting__avatar {
    width: 40px;
    height: 40px;
    min-width: 40px;
    font-size: 16px;
  }

  .dashboard-greeting__text h2 {
    font-size: 17px;
  }

  .quick-action-btn {
    height: 32px;
    font-size: 12px;
    padding: 0 10px;
  }
}

/* =========================
   15. LOGIN SPLIT-SCREEN
   ========================= */

.login-split {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

.login-split__brand {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(37, 99, 235, 0.15), transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(16, 185, 129, 0.08), transparent 40%),
    var(--grad-dark-btn, linear-gradient(135deg, #111113 0%, #1a1a1e 50%, #111113 100%));
  position: relative;
  overflow: hidden;
}

.login-split__brand::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(0deg, transparent, transparent 49px, rgba(255, 255, 255, 0.03) 50px),
    repeating-linear-gradient(90deg, transparent, transparent 49px, rgba(255, 255, 255, 0.03) 50px);
  background-size: 50px 50px;
  mask-image: radial-gradient(ellipse at center, black, transparent 80%);
}

.login-split__brand-content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 420px;
}

.login-split__brand-logo {
  width: 200px;
  max-width: 80%;
  height: auto;
  margin-bottom: 32px;
  filter: brightness(1.1);
}

.login-split__tagline {
  font-size: 30px;
  font-weight: 900;
  font-family: var(--font-display);
  color: #ffffff;
  line-height: 1.14;
  letter-spacing: -0.03em;
  margin: 0 0 14px;
  text-wrap: balance;
}

.login-split__description {
  font-size: 16px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.7;
  margin: 0;
  max-width: 34ch;
  margin-inline: auto;
}

.login-split__stats {
  display: flex;
  gap: 32px;
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.login-split__stat {
  text-align: center;
}

.login-split__stat-value {
  display: block;
  font-size: 28px;
  font-weight: 900;
  font-family: var(--font-display);
  color: #ffffff;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.login-split__stat-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.40);
  margin-top: 4px;
}

.login-split__form {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 40px;
  background: var(--surface-page);
  max-width: 560px;
}

@media (max-width: 1024px) {
  .login-split {
    flex-direction: column;
  }

  .login-split__brand {
    min-height: 200px;
    flex: none;
    padding: 32px 24px;
  }

  .login-split__tagline {
    font-size: 22px;
  }

  .login-split__stats {
    display: none;
  }

  .login-split__form {
    max-width: 100%;
    flex: 1;
    padding: 24px 20px;
  }
}

@media (max-width: 639px) {
  .login-split__brand {
    min-height: 160px;
    padding: 24px 16px;
  }

  .login-split__brand-logo {
    width: 140px;
    margin-bottom: 16px;
  }

  .login-split__tagline {
    font-size: 18px;
  }

  .login-split__description {
    font-size: 13px;
  }
}

/* =========================
   16. CARD HOVER MICRO-INTERACTIONS
   ========================= */

.job-card,
.panel-card,
.admin-nav-card,
.admin-kpi-card {
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

/* =========================
   17. SCROLLBAR STYLING
   ========================= */

.app-content {
  scrollbar-width: thin;
  scrollbar-color: var(--border-default) transparent;
}

.app-content::-webkit-scrollbar {
  width: 6px;
}

.app-content::-webkit-scrollbar-track {
  background: transparent;
}

.app-content::-webkit-scrollbar-thumb {
  background-color: var(--border-default);
  border-radius: 3px;
}

.app-content::-webkit-scrollbar-thumb:hover {
  background-color: var(--border-strong);
}

/* (Section 18: Kanban badges/WIP/collapse — removed) */

/* =========================================================
   19. CUSTOMER — Contact avatars + side-panel detail
   ========================================================= */

/* Contact person letter avatar */
.contact-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  min-width: 26px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 11px;
  font-weight: 800;
  margin-right: 6px;
  vertical-align: middle;
}

/* Side panel (slide-in detail) */
.customer-side-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 420px;
  max-width: 90vw;
  height: 100vh;
  background: var(--surface-card);
  border-left: 1px solid var(--border-soft);
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.10);
  z-index: 100;
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.customer-side-panel.is-open {
  transform: translateX(0);
}
.customer-side-panel__overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.25);
  z-index: 99;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.customer-side-panel__overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}
.customer-side-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border-soft);
}
.customer-side-panel__title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-primary);
  font-family: var(--font-display);
}
.customer-side-panel__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-dim);
  font-size: 16px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.customer-side-panel__close:hover {
  background: var(--surface-hover);
  color: var(--text-secondary);
}
.customer-side-panel__body {
  padding: 20px;
  flex: 1;
}
.customer-side-panel__row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-soft);
  font-size: 13px;
}
.customer-side-panel__label {
  color: var(--text-muted);
  font-weight: 600;
  flex-shrink: 0;
}
.customer-side-panel__value {
  color: var(--text-secondary);
  font-weight: 700;
  text-align: right;
  word-break: break-word;
}

.customer-side-panel__contact-heading {
  margin: 16px 0 6px;
  padding-top: 10px;
  border-top: 1px solid var(--border-light, #e2e8f0);
  color: var(--text-primary, #0f172a);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.customer-side-panel__section-title {
  margin: 20px 0 10px;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
}

/* Clickable row style for side-panel */
.customer-row--clickable {
  cursor: pointer;
  transition: background 0.12s ease;
}

/* ============================================================
   SUPPLIER SIDE PANEL — mirrors customer-side-panel layout
   ============================================================ */
.supplier-side-panel {
  position: fixed;
  top: 0;
  right: -380px;
  width: 360px;
  height: 100%;
  background: var(--theme-card-bg, #fff);
  border-left: 1px solid var(--theme-border, #e2e8f0);
  box-shadow: -4px 0 24px rgba(0,0,0,.10);
  z-index: 1050;
  display: flex;
  flex-direction: column;
  transition: right .28s cubic-bezier(.4,0,.2,1);
  overflow: hidden;
}
.supplier-side-panel.is-open { right: 0; }
.supplier-side-panel__overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.22);
  z-index: 1049;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}
.supplier-side-panel__overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}
.supplier-side-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--theme-border, #e2e8f0);
  flex-shrink: 0;
}
.supplier-side-panel__title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary, #0f172a);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: calc(100% - 36px);
}
.supplier-side-panel__close {
  background: none;
  border: none;
  font-size: 22px;
  line-height: 1;
  color: var(--text-dim, #64748b);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: background .12s, color .12s;
}
.supplier-side-panel__close:hover {
  background: var(--theme-hover-bg, #f1f5f9);
  color: var(--text-primary, #0f172a);
}
.supplier-side-panel__body {
  padding: 18px 20px;
  overflow-y: auto;
  flex: 1;
}
.supplier-side-panel__row {
  display: flex;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid var(--theme-border-light, #f1f5f9);
  font-size: 13px;
}
.supplier-side-panel__label {
  flex: 0 0 90px;
  font-weight: 600;
  color: var(--text-dim, #64748b);
  font-size: 12px;
}
.supplier-side-panel__value {
  flex: 1;
  color: var(--text-primary, #0f172a);
  word-break: break-word;
}
.supplier-side-panel__contact-heading {
  margin: 16px 0 6px;
  padding-top: 10px;
  border-top: 1px solid #e2e8f0;
  color: var(--text-primary, #0f172a);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
}

/* Shared customer/supplier details drawer parity contract. */
.directory-details-drawer {
  position: fixed;
  inset: 0 0 0 auto;
  z-index: 1050;
  display: flex;
  flex-direction: column;
  width: min(420px, 100vw);
  height: 100dvh;
  background: #fff;
  border-left: 1px solid #e2e8f0;
  box-shadow: -12px 0 32px rgba(15, 23, 42, .14);
  transform: translateX(100%);
  transition: transform .24s cubic-bezier(.22, 1, .36, 1);
  overflow: hidden;
}
.directory-details-drawer.is-open { transform: translateX(0); }
.directory-details-drawer__overlay {
  position: fixed;
  inset: 0;
  z-index: 1049;
  background: rgba(15, 23, 42, .28);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}
.directory-details-drawer__overlay.is-open { opacity: 1; pointer-events: auto; }
.directory-details-drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex: 0 0 auto;
  padding: 20px 24px;
  border-bottom: 1px solid #f1f5f9;
}
.directory-details-drawer__title {
  margin: 0;
  color: #0f172a;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -.01em;
}
.directory-details-drawer__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  font-size: 21px;
}
.directory-details-drawer__close:hover,
.directory-details-drawer__close:focus-visible { background: #f1f5f9; color: #334155; }
.directory-details-drawer__body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 20px 24px 28px;
}
.directory-details-drawer__section { display: flex; flex-direction: column; }
.directory-details-drawer__section--contact {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #e2e8f0;
}
.directory-details-drawer__section-title {
  margin: 0 0 6px;
  padding: 0 0 6px;
  color: #0f172a;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.directory-details-drawer__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
  padding: 8px 0;
  border-bottom: 1px solid #f8fafc;
}
.directory-details-drawer__label {
  flex: 0 0 auto;
  color: #64748b;
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
}
.directory-details-drawer__value,
.directory-details-drawer__email {
  min-width: 0;
  color: #0f172a;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.35;
  text-align: right;
  overflow-wrap: anywhere;
}
.directory-details-drawer__email { text-decoration: none; }
.directory-details-drawer__email:hover { color: #2563eb; text-decoration: underline; }
body.directory-details-drawer-open { overflow: hidden; }
@media (max-width: 560px) {
  .directory-details-drawer__header { padding: 18px 20px; }
  .directory-details-drawer__body { padding: 18px 20px 24px; }
  .directory-details-drawer__row { gap: 12px; }
}
.customer-row--clickable:hover {
  background: var(--surface-hover);
}

/* Column toggle for customer table */
.customer-directory-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

/* =========================================================
   20. SUPPLIER — Green accent + card grid view
   ========================================================= */

/* (Section 20: Supplier accent + view toggle + card grid — removed) */

/* =========================================================
   21. CHAT — @mentions, emoji reactions, typing indicator
   ========================================================= */

/* @mention autocomplete dropdown */
.ic-mention-dropdown {
  position: absolute;
  bottom: calc(100% + 4px);
  left: 12px;
  min-width: 240px;
  max-height: 200px;
  overflow-y: auto;
  background: var(--surface-card);
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  box-shadow: var(--shadow-md);
  z-index: 50;
  padding: 4px;
  display: none;
}
.ic-mention-dropdown.is-open {
  display: block;
  animation: fade-in 0.12s ease-out;
}
.ic-mention-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.1s ease;
}
.ic-mention-item:hover,
.ic-mention-item.is-highlighted {
  background: var(--surface-hover);
}
.ic-mention-item__avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
}
.ic-mention-item__name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}
.ic-mention-item__email {
  font-size: 11px;
  color: var(--text-muted);
}

/* @mention styled in message text */
.ic-mention {
  color: var(--brand);
  font-weight: 700;
  background: var(--brand-soft);
  padding: 1px 4px;
  border-radius: 4px;
}

/* Emoji reactions bar */
.ic-msg__reactions {
  display: flex;
  gap: 4px;
  margin-top: 4px;
  flex-wrap: wrap;
}
.ic-reaction {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  background: var(--surface-card);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.12s ease;
  line-height: 1;
}
.ic-reaction:hover {
  background: var(--surface-hover);
  border-color: var(--border-default);
}
.ic-reaction.is-own {
  background: var(--brand-soft);
  border-color: var(--brand-border);
}
.ic-reaction__count {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
}

/* Add reaction button */
.ic-msg__add-reaction {
  display: none;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: 1px dashed var(--border-soft);
  border-radius: 50%;
  background: transparent;
  color: var(--text-dim);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.12s ease;
}
.ic-msg:hover .ic-msg__add-reaction {
  display: inline-flex;
}
.ic-msg__add-reaction:hover {
  background: var(--surface-hover);
  border-color: var(--border-default);
  color: var(--text-secondary);
}

/* Quick emoji picker */
/* ── WhatsApp-style emoji reaction pill ── */
.ic-emoji-picker {
  position: absolute;
  bottom: calc(100% + 6px);
  right: -4px;
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: 6px 8px;
  background: var(--surface-card, #fff);
  border: 1px solid var(--border-soft, #e5e7eb);
  border-radius: 999px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.13), 0 1px 6px rgba(0,0,0,0.07);
  z-index: 51;
  pointer-events: none;
  opacity: 0;
  transform: scale(0.85) translateY(6px);
  transform-origin: bottom right;
  transition: opacity 0.18s ease, transform 0.18s cubic-bezier(0.34,1.56,0.64,1);
}
.ic-emoji-picker.is-open {
  display: flex;
  pointer-events: auto;
  opacity: 1;
  transform: scale(1) translateY(0);
}
/* Primary row — always visible */
.ic-emoji-picker__primary {
  display: flex;
  gap: 2px;
  align-items: center;
}
/* More row — hidden until expanded */
.ic-emoji-picker__more-row {
  display: none;
  gap: 2px;
  align-items: center;
}
.ic-emoji-picker__more-row.is-visible {
  display: flex;
}
/* Round the picker when more row is open */
.ic-emoji-picker.has-more-open {
  border-radius: 16px;
}
.ic-emoji-picker__btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  border-radius: 50%;
  font-size: 22px;
  cursor: pointer;
  transition: transform 0.15s cubic-bezier(0.34,1.56,0.64,1), background 0.1s ease;
  line-height: 1;
}
.ic-emoji-picker__btn:hover {
  transform: scale(1.3);
  background: var(--surface-hover, rgba(0,0,0,0.06));
}
/* "+" expand button */
.ic-emoji-picker__more-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-soft, #e5e7eb);
  background: var(--surface-2, #f1f5f9);
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
  color: var(--text-muted, #6b7280);
  font-weight: 700;
  transition: background 0.12s ease, transform 0.15s ease;
  flex-shrink: 0;
}
.ic-emoji-picker__more-btn:hover {
  background: var(--surface-hover, rgba(0,0,0,0.08));
  transform: scale(1.1);
}
/* Dark mode */
[data-theme="dark"] .ic-emoji-picker {
  background: #1f2024;
  border-color: #2c2d32;
  box-shadow: 0 4px 24px rgba(0,0,0,0.45);
}
[data-theme="dark"] .ic-emoji-picker__more-btn {
  background: #2c2d32;
  border-color: #3a3b42;
  color: #a0a3b1;
}
@media (prefers-color-scheme: dark) {
  [data-theme="auto"] .ic-emoji-picker {
    background: #1f2024;
    border-color: #2c2d32;
    box-shadow: 0 4px 24px rgba(0,0,0,0.45);
  }
  [data-theme="auto"] .ic-emoji-picker__more-btn {
    background: #2c2d32;
    border-color: #3a3b42;
    color: #a0a3b1;
  }
}
/* Hide old add-reaction button — picker now shows on bubble hover */
.ic-msg__add-reaction {
  position: absolute;
  bottom: -14px;
  right: 8px;
  opacity: 0;
  pointer-events: none;
  display: none;
}

/* Typing indicator */
.ic-typing-indicator {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
  font-style: italic;
}
.ic-typing-indicator.is-visible {
  display: flex;
  animation: fade-in 0.2s ease-out;
}

@keyframes typingDot {
  0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-3px); }
}
.ic-typing-dots {
  display: flex;
  gap: 3px;
}
.ic-typing-dots span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: typingDot 1.2s infinite;
}
.ic-typing-dots span:nth-child(2) { animation-delay: 0.15s; }
.ic-typing-dots span:nth-child(3) { animation-delay: 0.3s; }

/* =========================================================
   22. INQUIRY — Clean radio button styling
   ========================================================= */

.inquiry-date-mode {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 8px;
}
.inquiry-date-mode__option {
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 4px 10px;
  border-radius: 6px;
  transition: background 0.12s ease, color 0.12s ease;
}
.inquiry-date-mode__option:hover {
  background: var(--surface-hover);
}
.inquiry-date-mode__option input[type="radio"] {
  width: 15px;
  height: 15px;
  margin: 0;
}
.inquiry-date-mode__option input[type="radio"]:checked + span {
  color: var(--brand);
  font-weight: 700;
}

/* (Section 23: Sparklines — removed, needs real backend trend data) */

/* =========================================================
   24. EMPTY STATE SVG ILLUSTRATIONS
   Inline SVG-style with decorative shapes
   ========================================================= */

.empty-state-v2 {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
}
.empty-state-v2__illustration {
  width: 140px;
  height: 140px;
  margin-bottom: 20px;
  position: relative;
}
.empty-state-v2__circle {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: var(--surface-2);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.empty-state-v2__circle::before {
  content: '';
  position: absolute;
  width: 110%;
  height: 110%;
  border-radius: 50%;
  border: 2px dashed var(--border-soft);
  top: -5%;
  left: -5%;
  animation: emptyStateSpin 20s linear infinite;
}
@keyframes emptyStateSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.empty-state-v2__circle i {
  font-size: 48px;
  color: var(--text-dim);
  opacity: 0.6;
}
/* Floating decorative shapes */
.empty-state-v2__shape {
  position: absolute;
  border-radius: 50%;
  opacity: 0.5;
}
.empty-state-v2__shape--1 {
  width: 16px;
  height: 16px;
  background: var(--brand-soft);
  top: -4px;
  right: -4px;
  animation: emptyFloat 3s ease-in-out infinite;
}
.empty-state-v2__shape--2 {
  width: 10px;
  height: 10px;
  background: var(--success-soft);
  bottom: 8px;
  left: -6px;
  animation: emptyFloat 3s ease-in-out infinite 0.5s;
}
.empty-state-v2__shape--3 {
  width: 8px;
  height: 8px;
  background: var(--warning-soft);
  top: 20px;
  left: 4px;
  animation: emptyFloat 3s ease-in-out infinite 1s;
}
@keyframes emptyFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
.empty-state-v2__title {
  font-size: 17px;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0 0 6px;
  font-family: var(--font-display);
}
.empty-state-v2__text {
  font-size: 13px;
  color: var(--text-muted);
  max-width: 320px;
  line-height: 1.5;
  margin: 0;
}

/* Optional CTA below the sentence (UI Polish Pass — see UI_POLISH_AUDIT.md).
   Added once here so every module using .empty-state-v2 can opt in with
   just this one class, no per-module CSS needed. */
.empty-state-v2__cta {
  margin-top: 16px;
}

/* =========================================================
   25. MOBILE TABLE → CARD VIEW
   Tables become stacked cards on small screens
   ========================================================= */

@media (max-width: 768px) {
  /* Orders table → cards */
  .orders-table-wrap.mobile-cards-active thead {
    display: none;
  }
  .orders-table-wrap.mobile-cards-active tbody tr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px 12px;
    background: var(--surface-card);
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 10px;
    box-shadow: var(--shadow-xs);
  }
  .orders-table-wrap.mobile-cards-active tbody td {
    display: flex;
    flex-direction: column;
    padding: 4px 0;
    border: none !important;
  }
  .orders-table-wrap.mobile-cards-active tbody td::before {
    content: attr(data-label);
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-dim);
    margin-bottom: 2px;
  }
  /* First cell (INS) spans full width */
  .orders-table-wrap.mobile-cards-active tbody td:first-child {
    grid-column: 1 / -1;
    font-size: 15px;
    font-weight: 800;
    color: var(--brand);
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-soft) !important;
    margin-bottom: 4px;
  }
  /* Action cell spans full width */
  .orders-table-wrap.mobile-cards-active tbody td:last-child {
    grid-column: 1 / -1;
    padding-top: 8px;
    border-top: 1px solid var(--border-soft) !important;
    margin-top: 4px;
  }

  /* Customer table → cards */
  .customer-table-wrap.mobile-cards-active thead {
    display: none;
  }
  .customer-table-wrap.mobile-cards-active tbody tr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px 12px;
    background: var(--surface-card);
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 10px;
    box-shadow: var(--shadow-xs);
  }
  .customer-table-wrap.mobile-cards-active tbody td {
    display: flex;
    flex-direction: column;
    padding: 4px 0;
    border: none !important;
  }
  .customer-table-wrap.mobile-cards-active tbody td::before {
    content: attr(data-label);
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-dim);
    margin-bottom: 2px;
  }
  .customer-table-wrap.mobile-cards-active tbody td:first-child {
    grid-column: 1 / -1;
  }

  /* Supplier table → cards */
  .supplier-table-wrap.mobile-cards-active thead {
    display: none;
  }
  .supplier-table-wrap.mobile-cards-active tbody tr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px 12px;
    background: var(--surface-card);
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 10px;
    box-shadow: var(--shadow-xs);
  }
  .supplier-table-wrap.mobile-cards-active tbody td {
    display: flex;
    flex-direction: column;
    padding: 4px 0;
    border: none !important;
  }
  .supplier-table-wrap.mobile-cards-active tbody td::before {
    content: attr(data-label);
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-dim);
    margin-bottom: 2px;
  }
  .supplier-table-wrap.mobile-cards-active tbody td:first-child {
    grid-column: 1 / -1;
  }

  /* Hide columns that are too dense for mobile cards */
  .orders-table-wrap.mobile-cards-active .col-po,
  .orders-table-wrap.mobile-cards-active .col-order-no,
  .orders-table-wrap.mobile-cards-active .col-responsible {
    display: none;
  }
}

/* =========================
   ACCESSIBILITY: REDUCED MOTION
   WCAG 2.1 SC 2.3.3 — covers all animations in this file.
   p2-polish.css covers its own keyframes separately.
   ========================= */
@media (prefers-reduced-motion: reduce) {
  /* Page entrance & section stagger (enhancements.css lines ~99-108) */
  [data-animate="enter"],
  .dashboard-page__kpis,
  .dashboard-page__live-table,
  .dashboard-page__orders,
  .dashboard-page__lower-grid,
  .job-detail-layout__header,
  .job-detail-layout__section {
    animation: none !important;
    transition: none !important;
  }

  /* KPI card stagger (dashboard.css .metric-card:nth-child) */
  .dashboard-kpi-grid .metric-card {
    animation: none !important;
  }

  /* Skeleton loader shimmer rows */
  .table-skeleton-cell {
    animation: none !important;
    opacity: 0.6;
  }

  .toast-notification {
    animation: none !important;
  }

  .empty-state-icon {
    animation: none !important;
  }

  .empty-float,
  [class*="empty-float"] {
    animation: none !important;
  }

  /* Typing dots (ic-typing-dots span:nth-child stagger) */
  .typing-dot,
  .ic-typing-dots span {
    animation: none !important;
    opacity: 0.5;
  }
}
