/* ==========================================================================
   Embellishment In-H Revenue KKN — Fixed 100vw x 100vh No-Scroll Layout
   Large, High-Legibility Typography Edition
   ========================================================================== */

:root {
  --bg-app: #f1f5f9;
  --bg-sidebar: #0f172a;
  --bg-sidebar-hover: #1e293b;
  --bg-surface: #ffffff;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-soft: #eff6ff;
  --emerald: #059669;
  --emerald-soft: #ecfdf5;
  --amber: #d97706;
  --amber-soft: #fffbeb;
  --violet: #7c3aed;
  --violet-soft: #f5f3ff;
  --rose: #e11d48;
  --rose-soft: #fff1f2;
  --cyan: #0891b2;
  --slate-50: #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
  --slate-900: #0f172a;
  --radius: 10px;
  --font-sans: 'Sarabun', 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100vw;
  height: 100vh;
  overflow: hidden; /* Strictly no page scrollbars */
  font-family: var(--font-sans);
  background: var(--bg-app);
  color: var(--slate-800);
  font-size: 16px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   APP SHELL: LEFT SIDEBAR + RIGHT WORKSPACE
   ========================================================================== */
.app-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

/* --- LEFT SIDEBAR --- */
.sidebar {
  background: var(--bg-sidebar);
  color: #ffffff;
  display: flex;
  flex-direction: column;
  padding: 1.1rem 0.95rem;
  height: 100vh;
  overflow: hidden;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.25rem 0.35rem 1.05rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.brand-logo {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

.brand-titles h1 {
  font-size: 1.12rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #ffffff;
  line-height: 1.25;
}

.brand-titles span {
  font-size: 0.92rem;
  color: #60a5fa;
  font-weight: 600;
}

.sidebar-section-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--slate-400);
  letter-spacing: 0.06em;
  margin: 1rem 0.35rem 0.5rem;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.75rem 0.85rem;
  border-radius: 9px;
  border: 1px solid transparent;
  background: transparent;
  color: #cbd5e1;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s ease;
}

.nav-item:hover {
  background: var(--bg-sidebar-hover);
  color: #ffffff;
}

.nav-item.active {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
  border-color: rgba(96, 165, 250, 0.35);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.nav-step {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.14);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.92rem;
  font-weight: 700;
  flex-shrink: 0;
}

.nav-item.active .nav-step {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
}

.nav-text {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  width: 100%;
}

.nav-text strong {
  font-size: 1.02rem;
  font-weight: 700;
}

.nav-text small {
  font-size: 0.84rem;
  opacity: 0.85;
}

.missing-pill-mini {
  background: #ef4444;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.08rem 0.5rem;
  border-radius: 999px;
}

/* Sidebar Missing Price Shortcut Alert */
.sidebar-alert-box {
  margin-top: 0.9rem;
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(245, 158, 11, 0.45);
  border-radius: 9px;
  padding: 0.65rem 0.75rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.sidebar-alert-box:hover {
  background: rgba(245, 158, 11, 0.24);
  border-color: #fbbf24;
}

.sidebar-alert-box.rose-alert {
  background: rgba(244, 63, 94, 0.14);
  border-color: rgba(244, 63, 94, 0.45);
}

.sidebar-alert-box.rose-alert:hover {
  background: rgba(244, 63, 94, 0.24);
  border-color: #fb7185;
}

.sidebar-alert-box.rose-alert .alert-box-top,
.sidebar-alert-box.rose-alert .alert-box-top strong {
  color: #fda4af;
}

.alert-box-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.88rem;
  color: #fde68a;
}

.alert-box-top strong {
  color: #fbbf24;
  font-weight: 700;
  font-size: 0.92rem;
}

.sidebar-alert-box small {
  display: block;
  font-size: 0.8rem;
  color: #cbd5e1;
  margin-top: 3px;
}

/* Sidebar Widgets */
.sidebar-widget {
  margin-top: auto;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 9px;
  padding: 0.75rem;
}

.widget-label {
  display: block;
  font-size: 0.84rem;
  color: #94a3b8;
  margin-bottom: 0.4rem;
}

.rate-box {
  display: flex;
  align-items: center;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 7px;
  padding: 0.35rem 0.6rem;
  gap: 0.4rem;
}

.rate-prefix, .rate-suffix {
  font-size: 0.9rem;
  font-weight: 700;
  color: #34d399;
}

.rate-box input {
  width: 100%;
  background: transparent;
  border: none;
  color: #ffffff;
  font-weight: 700;
  font-size: 1.05rem;
  text-align: right;
  outline: none;
}

.sidebar-footer {
  margin-top: 0.75rem;
}

.btn-export-full {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  background: #059669;
  color: #ffffff;
  border: none;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}

.btn-export-full:hover {
  background: #047857;
}

/* ==========================================================================
   RIGHT WORKSPACE: TOP BAR + ACTIVE PAGE (NO SCROLL)
   ========================================================================== */
.workspace {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100%;
  padding: 0.65rem 0.95rem;
  gap: 0.55rem;
  overflow: hidden;
}

/* Top Bar */
.top-bar {
  background: var(--bg-surface);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius);
  padding: 0.6rem 0.95rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  flex-shrink: 0;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.top-bar-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.top-bar-title h2 {
  font-size: 1.18rem;
  font-weight: 700;
  color: var(--slate-900);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.live-badge {
  background: var(--primary-soft);
  color: var(--primary);
  border: 1px solid #bfdbfe;
  padding: 0.22rem 0.75rem;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 700;
  white-space: nowrap;
}

/* Filters Row */
.filters-row {
  display: grid;
  grid-template-columns: 1.35fr 1.1fr 0.9fr 0.9fr 1.45fr auto;
  gap: 0.55rem;
  align-items: end;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.filter-group label {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--slate-700);
}

.filter-group select,
.filter-group input {
  height: 34px;
  padding: 0 0.6rem;
  border: 1px solid var(--slate-300);
  border-radius: 7px;
  font-family: inherit;
  font-size: 0.92rem;
  color: var(--slate-900);
  background: #fff;
  outline: none;
  width: 100%;
}

.filter-group.emb-highlight select {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary-hover);
  font-weight: 700;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  height: 34px;
  padding: 0 0.8rem;
  border-radius: 7px;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover { background: var(--primary-hover); }

.btn-emerald {
  background: var(--emerald);
  color: #fff;
}
.btn-emerald:hover { background: #047857; }

.btn-amber {
  background: #fffbeb;
  color: #b45309;
  border-color: #fde68a;
}
.btn-amber:hover { background: #fef3c7; }

.btn-danger-outline {
  background: #fff;
  color: var(--rose);
  border-color: #fecdd3;
}
.btn-danger-outline:hover { background: #fff1f2; }

.btn-reset {
  background: var(--slate-100);
  color: var(--slate-700);
  border-color: var(--slate-300);
}
.btn-reset:hover { background: var(--slate-200); }

/* ==========================================================================
   PAGE VIEWS (FIXED HEIGHT, NO SCROLL)
   ========================================================================== */
.page-view {
  display: none;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  flex-direction: column;
  gap: 0.55rem;
}

.page-view.active {
  display: flex;
}

/* KPI Strip */
.kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.55rem;
  flex-shrink: 0;
}

.kpi-box {
  background: var(--bg-surface);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius);
  padding: 0.55rem 0.85rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.kpi-box.emerald-box {
  background: linear-gradient(135deg, #ecfdf5, #ffffff);
  border-color: #a7f3d0;
}

.kpi-label {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--slate-600);
}

.kpi-num-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-top: 0.15rem;
}

.kpi-num-row strong {
  font-size: 1.38rem;
  font-weight: 700;
  color: var(--slate-900);
}

.kpi-box.emerald-box .kpi-num-row strong {
  color: var(--emerald);
}

.kpi-num-row small {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--slate-500);
}

/* ==========================================================================
   PAGE 3: MASTER PRICE & MISSING PRICE PROCESS STRIP
   ========================================================================== */
.emb-missing-strip {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.5rem;
  flex-shrink: 0;
}

.emb-process-card {
  background: var(--bg-surface);
  border: 1px solid var(--slate-200);
  border-radius: 9px;
  padding: 0.5rem 0.7rem;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.emb-process-card:hover {
  border-color: var(--primary);
  background: var(--slate-50);
}

.emb-process-card.active {
  border-color: var(--primary);
  background: var(--primary-soft);
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.12);
}

.emb-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}

.emb-card-name {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--slate-900);
}

.emb-card-total {
  font-size: 0.8rem;
  color: var(--slate-600);
  font-weight: 600;
}

.emb-card-counts {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.84rem;
  margin-top: 2px;
}

.count-ok {
  color: var(--emerald);
  font-weight: 700;
}

.count-missing {
  color: var(--rose);
  font-weight: 700;
  background: var(--rose-soft);
  padding: 0.08rem 0.45rem;
  border-radius: 5px;
}

.count-missing.zero {
  color: var(--slate-400);
  background: var(--slate-100);
  font-weight: 500;
}

/* Status Filter Pills in Master Price */
.status-filter-pills {
  display: inline-flex;
  background: var(--slate-100);
  padding: 3px;
  border-radius: 8px;
  border: 1px solid var(--slate-200);
  gap: 3px;
}

.status-pill {
  border: none;
  background: transparent;
  padding: 0.3rem 0.75rem;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--slate-700);
  cursor: pointer;
  transition: all 0.12s;
}

.status-pill:hover {
  color: var(--slate-900);
}

.status-pill.active[data-pstatus="ALL"] {
  background: var(--slate-800);
  color: #fff;
}

.status-pill.active[data-pstatus="MULTI_PRICE"] {
  background: var(--amber);
  color: #fff;
}

.status-pill.active[data-pstatus="MISSING"] {
  background: var(--rose);
  color: #fff;
}

.status-pill.active[data-pstatus="CONFIRMED"],
.status-pill.active[data-pstatus="HAS_PRICE"] {
  background: var(--emerald);
  color: #fff;
}

.status-pill.active[data-pstatus="EDITED"] {
  background: var(--primary);
  color: #fff;
}

.variant-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-wrap: nowrap;
}

.variant-btn {
  height: 25px;
  padding: 0 0.5rem;
  border-radius: 5px;
  border: 1px solid #f59e0b;
  background: #fffbeb;
  color: #b45309;
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.12s;
}

.variant-btn:hover {
  background: #fef3c7;
  border-color: #d97706;
}

.variant-btn.selected {
  background: var(--emerald);
  border-color: var(--emerald);
  color: #ffffff;
}

.variant-btn.unconfirmed-max {
  background: #fef3c7;
  border-color: #d97706;
  color: #92400e;
  box-shadow: inset 0 0 0 1px #d97706;
}

.status-tag.multi {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
  display: inline-block;
  padding: 0.12rem 0.52rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
}

.fixed-table tbody tr.row-multi {
  background: #fffdf5;
}
.fixed-table tbody tr.row-multi:hover {
  background: #fef9c3;
}

/* Staff Input Box */
.staff-input-box {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--slate-50);
  border: 1px solid var(--slate-300);
  border-radius: 7px;
  padding: 0 0.55rem;
  height: 34px;
}

.staff-input-box label {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--slate-700);
  white-space: nowrap;
}

.staff-input-box input {
  border: none;
  background: transparent;
  width: 110px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--primary);
  outline: none;
}

/* Panels & Table Containers */
.panel {
  background: var(--bg-surface);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius);
  padding: 0.65rem 0.85rem;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.table-panel {
  flex: 1;
  min-height: 0;
}

.panel-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid var(--slate-100);
  flex-shrink: 0;
  flex-wrap: nowrap;
}

.toolbar-left, .toolbar-right {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.mode-switch {
  display: inline-flex;
  background: var(--slate-100);
  padding: 3px;
  border-radius: 7px;
  border: 1px solid var(--slate-200);
}

.mode-btn {
  border: none;
  background: transparent;
  padding: 0.3rem 0.75rem;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--slate-600);
  cursor: pointer;
}

.mode-btn.active {
  background: var(--primary);
  color: #fff;
}

.record-counter {
  font-size: 0.86rem;
  color: var(--slate-600);
  font-weight: 700;
  white-space: nowrap;
}

/* Pagination Bar */
.pagination-bar {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.page-btn {
  height: 30px;
  padding: 0 0.65rem;
  border-radius: 6px;
  border: 1px solid var(--slate-300);
  background: #fff;
  color: var(--slate-800);
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
}

.page-btn:hover:not(:disabled) {
  background: var(--slate-100);
}

.page-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.page-info {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--slate-800);
  min-width: 68px;
  text-align: center;
}

/* Fixed Table — Zero Scrollbars, Larger Text */
.fixed-table-container {
  flex: 1;
  min-height: 0;
  width: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.fixed-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
}

.fixed-table th,
.fixed-table td {
  padding: 0.44rem 0.5rem;
  font-size: 0.92rem;
  border-bottom: 1px solid var(--slate-100);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left;
}

.fixed-table thead th {
  background: var(--slate-50);
  color: var(--slate-800);
  font-weight: 700;
  border-bottom: 2px solid var(--slate-200);
  font-size: 0.88rem;
}

.fixed-table thead tr.sub-header th {
  font-size: 0.82rem;
  padding: 0.28rem 0.45rem;
  background: #f8fafc;
}

.fixed-table tbody tr:hover {
  background: #f8fafc;
}

.fixed-table tbody tr.row-missing {
  background: #fffafa;
}

.fixed-table tbody tr.row-missing:hover {
  background: #fff1f2;
}

.fixed-table tbody tr.clickable-row {
  cursor: pointer;
}

.fixed-table tfoot td {
  background: var(--slate-100);
  font-weight: 700;
  font-size: 0.92rem;
  border-top: 2px solid var(--slate-300);
  border-bottom: none;
  padding: 0.48rem 0.5rem;
}

.text-right { text-align: right !important; }
.text-center { text-align: center !important; }
.font-bold { font-weight: 700; }

.sort-btn {
  background: none;
  border: none;
  font: inherit;
  font-weight: 700;
  color: inherit;
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 2px;
}
.sort-btn:hover { color: var(--primary); }

/* Plant & Emb Badges */
.badge {
  display: inline-block;
  padding: 0.12rem 0.48rem;
  border-radius: 5px;
  font-size: 0.82rem;
  font-weight: 700;
}

.plant-1411 { background: #e0f2fe; color: #0369a1; }
.plant-1412 { background: #fef3c7; color: #b45309; }
.plant-1414 { background: #f3e8ff; color: #7e22ce; }

.emb-badge {
  display: inline-block;
  padding: 0.12rem 0.5rem;
  border-radius: 5px;
  font-size: 0.82rem;
  font-weight: 700;
}
.emb-Fuse { background: #dbeafe; color: #1d4ed8; }
.emb-HeatTransfer { background: #ffedd5; color: #c2410c; }
.emb-Emboss { background: #f3e8ff; color: #6d28d9; }
.emb-Deboss { background: #fce7f3; color: #be185d; }
.emb-LaminateBonding { background: #ccfbf1; color: #0f766e; }
.emb-Laser { background: #fef9c3; color: #a16207; }

.status-tag {
  display: inline-block;
  padding: 0.12rem 0.52rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
}
.status-tag.missing {
  background: #ffe4e6;
  color: #be123c;
  border: 1px solid #fecdd3;
}
.status-tag.ok {
  background: #d1fae5;
  color: #047857;
}

.cutorder-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--slate-100);
  border: 1px solid var(--slate-300);
  border-radius: 5px;
  padding: 0.1rem 0.45rem;
  font-family: monospace;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--slate-900);
  cursor: pointer;
}
.cutorder-chip:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-soft);
}

.stamp-badge {
  display: inline-block;
  font-size: 0.82rem;
  color: var(--slate-600);
}
.stamp-badge.staff-stamped {
  color: var(--primary);
  font-weight: 700;
  background: var(--primary-soft);
  padding: 0.1rem 0.45rem;
  border-radius: 5px;
}

.th-plant.p-1411 { background: #e0f2fe; color: #0369a1; text-align: center; }
.th-plant.p-1412 { background: #fef3c7; color: #b45309; text-align: center; }
.th-plant.p-1414 { background: #f3e8ff; color: #7e22ce; text-align: center; }
.th-total { background: #dcfce7; color: #15803d; text-align: center; }

.table-input {
  width: 90px;
  height: 28px;
  padding: 0 6px;
  border: 1px solid var(--slate-300);
  border-radius: 5px;
  text-align: right;
  font-size: 0.9rem;
  font-weight: 700;
}

.table-input.input-missing {
  border-color: #f43f5e;
  background: #fff1f2;
  color: #be123c;
}

.table-input.input-ok {
  border-color: #10b981;
  background: #ecfdf5;
  color: #047857;
}

.btn-mini {
  height: 26px;
  padding: 0 0.55rem;
  font-size: 0.82rem;
  font-weight: 700;
  border-radius: 5px;
  border: 1px solid var(--slate-300);
  background: #fff;
  color: var(--slate-800);
  cursor: pointer;
}
.btn-mini:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ==========================================================================
   PAGE 1: IMPORT DATA LAYOUT
   ========================================================================== */
.import-layout {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  flex: 1;
  min-height: 0;
}

.import-cards-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  flex: 1;
  min-height: 0;
}

.import-panel {
  justify-content: space-between;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.35rem;
}

.panel-header h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--slate-900);
  margin-top: 0.15rem;
}

.step-pill {
  display: inline-block;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.12rem 0.55rem;
  border-radius: 5px;
}
.step-pill.sap { background: var(--emerald-soft); color: var(--emerald); }

.tag-badge {
  background: var(--slate-100);
  color: var(--slate-700);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.18rem 0.6rem;
  border-radius: 6px;
}
.tag-badge.emerald { background: var(--emerald-soft); color: var(--emerald); }

.panel-desc {
  font-size: 0.9rem;
  color: var(--slate-600);
  margin-bottom: 0.5rem;
}

.dropzone {
  flex: 1;
  border: 2px dashed var(--slate-300);
  border-radius: 9px;
  background: var(--slate-50);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.8rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s ease;
  color: var(--primary);
}

.dropzone:hover, .dropzone.dragover {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.dropzone.sap-zone { color: var(--emerald); }
.dropzone.sap-zone:hover, .dropzone.sap-zone.dragover {
  border-color: var(--emerald);
  background: var(--emerald-soft);
}

.dropzone.pa-zone {
  color: #047857;
  border-color: #6ee7b7;
  background: linear-gradient(135deg, #f0fdf4, #ffffff);
  padding: 0.65rem 0.8rem;
}
.dropzone.pa-zone:hover, .dropzone.pa-zone.dragover {
  border-color: var(--emerald);
  background: #d1fae5;
}

.visually-hidden {
  position: absolute;
  clip-path: inset(50%);
  overflow: hidden;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  white-space: nowrap;
}

.editable-cell {
  cursor: pointer;
  border-bottom: 1px dashed var(--slate-400);
  padding-bottom: 1px;
}
.editable-cell:hover {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.dropzone-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  color: var(--slate-800);
  font-size: 0.96rem;
}
.dropzone-text span {
  font-size: 0.84rem;
  color: var(--slate-500);
}

.status-banner {
  margin-top: 0.45rem;
  padding: 0.45rem 0.7rem;
  border-radius: 7px;
  font-size: 0.88rem;
  background: var(--slate-100);
  color: var(--slate-800);
}
.status-banner.success {
  background: var(--emerald-soft);
  color: #065f46;
  border: 1px solid #a7f3d0;
}
.status-banner.error {
  background: #fff1f2;
  color: #9f1239;
  border: 1px solid #fecdd3;
}

.import-summary-panel {
  flex-shrink: 0;
}

.storage-btns {
  display: flex;
  gap: 0.5rem;
}

.emb-overview-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.5rem;
  margin-top: 0.35rem;
}

.emb-stat-card {
  border: 1px solid var(--slate-200);
  border-radius: 9px;
  padding: 0.55rem 0.65rem;
  background: var(--slate-50);
  cursor: pointer;
  transition: all 0.15s;
}
.emb-stat-card:hover {
  border-color: var(--primary);
  background: #fff;
}
.emb-stat-card .emb-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--slate-800);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.emb-stat-card .emb-qty {
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--primary);
  margin-top: 0.2rem;
}
.emb-stat-card .emb-rev {
  font-size: 0.84rem;
  color: var(--emerald);
  font-weight: 700;
}

/* Modal */
.modal-dialog {
  border: none;
  border-radius: 12px;
  padding: 0;
  width: min(95vw, 1220px);
  max-height: 88vh;
  margin: auto;
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.3);
  overflow: hidden;
}
.modal-dialog::backdrop {
  background: rgba(15, 23, 42, 0.55);
}
.modal-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #fff;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.1rem;
  border-bottom: 1px solid var(--slate-200);
}
.modal-header h3 { font-size: 1.12rem; font-weight: 700; }
.modal-subtitle { font-size: 0.88rem; color: var(--slate-600); }
.modal-header-right { display: flex; align-items: center; gap: 0.75rem; }
.modal-close {
  border: none;
  background: var(--slate-100);
  width: 32px;
  height: 32px;
  border-radius: 7px;
  font-size: 1.25rem;
  cursor: pointer;
}
.modal-body {
  padding: 0.75rem 1.1rem 0.95rem;
  overflow: hidden;
}

/* ==========================================================================
   PAGE 2: DAILY REVENUE STACKED BAR CHART & PLANT QUICK FILTER PILLS
   ========================================================================== */
.chart-panel {
  flex-shrink: 0;
  padding: 0.55rem 0.85rem 0.45rem;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.chart-title-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.chart-title-group h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--slate-900);
}

.plant-quick-pills {
  display: inline-flex;
  background: var(--slate-100);
  padding: 2px;
  border-radius: 7px;
  border: 1px solid var(--slate-200);
  gap: 3px;
}

.plant-pill {
  border: none;
  background: transparent;
  padding: 0.2rem 0.65rem;
  border-radius: 5px;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--slate-700);
  cursor: pointer;
  transition: all 0.12s;
}

.plant-pill:hover {
  color: var(--slate-900);
  background: rgba(255, 255, 255, 0.7);
}

.plant-pill.active[data-plant="ALL"] {
  background: var(--slate-800);
  color: #fff;
}

.plant-pill.active.p-1411 {
  background: #2563eb;
  color: #fff;
}

.plant-pill.active.p-1412 {
  background: #7c3aed;
  color: #fff;
}

.plant-pill.active.p-1414 {
  background: #0d9488;
  color: #fff;
}

.chart-legend {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--slate-700);
  background: var(--slate-50);
  border: 1px solid var(--slate-200);
  padding: 0.12rem 0.5rem;
  border-radius: 99px;
  cursor: pointer;
  transition: all 0.12s;
}

.legend-item:hover {
  border-color: var(--primary);
  background: #fff;
}

.legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 2px;
  display: inline-block;
}

.bar-chart-stage {
  height: 112px;
  display: flex;
  align-items: flex-end;
  gap: 4px;
  padding: 16px 4px 0;
  border-bottom: 1px solid var(--slate-200);
  background: linear-gradient(to bottom, rgba(241, 245, 249, 0.45) 1px, transparent 1px);
  background-size: 100% 25%;
}

.bar-col {
  flex: 1;
  min-width: 14px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  cursor: pointer;
  position: relative;
  group: bar;
}

.bar-col:hover .bar-stack {
  filter: brightness(1.06);
  transform: scaleX(1.06);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.18);
}

.bar-top-val {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--slate-600);
  margin-bottom: 2px;
  white-space: nowrap;
  line-height: 1;
}

.bar-stack {
  width: 78%;
  max-width: 34px;
  border-radius: 5px 5px 0 0;
  overflow: hidden;
  display: flex;
  flex-direction: column-reverse;
  transition: all 0.15s ease;
  background: var(--slate-100);
}

.bar-segment {
  width: 100%;
  transition: height 0.25s ease;
}

.bar-date-lbl {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--slate-600);
  margin-top: 3px;
  padding-bottom: 2px;
  white-space: nowrap;
  line-height: 1.1;
}

.chart-tooltip {
  position: fixed;
  z-index: 9999;
  background: rgba(15, 23, 42, 0.96);
  color: #fff;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  font-size: 0.82rem;
  pointer-events: none;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.28);
  min-width: 210px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.chart-tooltip-title {
  font-weight: 700;
  font-size: 0.88rem;
  color: #38bdf8;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  padding-bottom: 4px;
  margin-bottom: 5px;
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
}

.chart-tooltip-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin: 2px 0;
}

.pivot-qty-sub {
  display: block;
  font-size: 0.74rem;
  color: var(--slate-500);
  font-weight: 500;
  line-height: 1.05;
}
