/**
 * MMS V2 Component Library
 * High-Quality Components: Buttons, Badges, Forms, Tables, Cards, Modals, Alerts
 * Touch-Friendly (≥44px targets), Tabular Typography, No AI Slop Aesthetics
 */

/* ========================================================================
   BUTTONS: Touch-Friendly Interactive Elements (≥44px)
   ======================================================================== */

.v2-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--touch-target-min);
  padding: 0 20px;
  font-family: var(--mms-font-sans);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
}

.v2-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Button Variants: Primary (Panasonic Blue #0057b8) */
.v2-btn-primary {
  background: var(--color-brand, #0057b8);
  color: white;
  border-color: var(--color-brand, #0057b8);
  box-shadow: 0 1px 2px rgba(0, 87, 184, 0.2);
}

.v2-btn-primary:hover {
  background: var(--color-brand-strong, #00458f);
  border-color: var(--color-brand-strong, #00458f);
  box-shadow: 0 2px 4px rgba(0, 87, 184, 0.25);
}

.v2-btn-primary:active {
  background: #003366;
  border-color: #003366;
  box-shadow: none;
}

/* Button Variants: Secondary (Crisp Industrial Surface) */
.v2-btn-secondary {
  background: var(--mms-surface);
  color: var(--mms-obsidian);
  border-color: var(--mms-border-strong);
  box-shadow: var(--shadow-xs);
}

.v2-btn-secondary:hover {
  background: var(--mms-surface-subtle);
  border-color: var(--mms-obsidian-subtle);
  color: var(--mms-obsidian);
}

.v2-btn-secondary:active {
  background: var(--mms-surface-active);
}

/* Button Variants: Outline Primary */
.v2-btn-outline-primary {
  background: transparent;
  color: var(--mms-brand-primary);
  border-color: var(--mms-brand-primary-border);
}

.v2-btn-outline-primary:hover {
  background: var(--mms-brand-primary-soft);
  border-color: var(--mms-brand-primary);
  color: var(--mms-brand-primary-hover);
}

/* Button Variants: Danger (Rose) */
.v2-btn-danger {
  background: var(--mms-status-danger);
  color: white;
  border-color: var(--mms-status-danger);
}

.v2-btn-danger:hover {
  background: var(--mms-status-danger-hover);
  border-color: var(--mms-status-danger-hover);
}

/* Button Variants: Ghost (Transparent) */
.v2-btn-ghost {
  background: transparent;
  color: var(--mms-obsidian-muted);
  border-color: transparent;
}

.v2-btn-ghost:hover {
  background: var(--mms-surface-hover);
  color: var(--mms-obsidian);
}

/* Button Sizes */
.v2-btn-sm {
  min-height: 36px;
  padding: 0 14px;
  font-size: 13px;
}

.v2-btn-lg {
  min-height: var(--touch-target-station);
  padding: 0 28px;
  font-size: 16px;
  font-weight: 600;
}

/* ========================================================================
   BADGES & CHIPS: Soft Industrial Palette (Accessible, High Contrast, Anti-Slop)
   ======================================================================== */

.v2-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  transition: background var(--transition-fast), color var(--transition-fast);
}

/* Badge Variants: Harmonious Soft Tinted (Crypto Blue) */
.v2-badge-primary {
  background: var(--mms-brand-primary-soft);
  color: var(--mms-brand-primary);
  border: 1px solid var(--mms-brand-primary-border);
}

.v2-badge-indigo {
  background: var(--mms-accent-machine-soft);
  color: var(--mms-accent-machine);
  border: 1px solid var(--mms-accent-machine-border);
}

.v2-badge-secondary {
  background: var(--mms-surface-subtle);
  color: var(--mms-obsidian-muted);
  border: 1px solid var(--mms-border);
}

.v2-badge-success {
  background: var(--mms-status-success-bg);
  color: var(--mms-status-success);
  border: 1px solid var(--mms-status-success-border);
}

.v2-badge-warning {
  background: var(--mms-status-warning-bg);
  color: var(--mms-status-warning);
  border: 1px solid var(--mms-status-warning-border);
}

.v2-badge-danger {
  background: var(--mms-status-danger-bg);
  color: var(--mms-status-danger);
  border: 1px solid var(--mms-status-danger-border);
}

.v2-badge-info {
  background: #F0F9FF;
  color: #0369A1;
  border: 1px solid #BAE6FD;
}

.v2-badge-neutral {
  background: #F8FAFC;
  color: #334155;
  border: 1px solid #E2E8F0;
}

/* Badge Variant: Solid */
.v2-badge-solid-primary {
  background: var(--color-brand, #0057b8);
  color: white;
}

.v2-badge-solid-success {
  background: var(--mms-status-success);
  color: white;
}

.v2-badge-solid-warning {
  background: var(--mms-status-warning);
  color: white;
}

.v2-badge-solid-danger {
  background: var(--mms-status-danger);
  color: white;
}

/* Subtle aliases */
.v2-badge-success-subtle {
  background: #ECFDF5;
  color: #047857;
  border: 1px solid #A7F3D0;
}

.v2-badge-warning-subtle {
  background: #FFFBEB;
  color: #B45309;
  border: 1px solid #FDE68A;
}

.v2-badge-danger-subtle {
  background: #FFF1F2;
  color: #BE123C;
  border: 1px solid #FECDD3;
}

.v2-badge-info-subtle {
  background: #F0F9FF;
  color: #0369A1;
  border: 1px solid #BAE6FD;
}

.v2-badge-neutral-subtle {
  background: #F8FAFC;
  color: #334155;
  border: 1px solid #E2E8F0;
}

/* SMT Material Classification Badges */
.v2-badge-axl {
  background: var(--mms-status-success-bg);
  color: var(--mms-status-success);
  border: 1px solid var(--mms-status-success-border);
}

.v2-badge-rhs {
  background: var(--mms-status-warning-bg);
  color: var(--mms-status-warning);
  border: 1px solid var(--mms-status-warning-border);
}

.v2-badge-smt {
  background: var(--mms-status-info-bg);
  color: var(--mms-status-info);
  border: 1px solid var(--mms-status-info-border);
}

.v2-badge-pcb {
  background: var(--mms-accent-indigo-soft);
  color: var(--mms-accent-indigo);
  border: 1px solid var(--mms-accent-indigo-soft);
}

/* Circuit Designator Tag Pills */
.v2-designator-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

.v2-designator-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  font-family: var(--mms-font-mono, monospace);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  color: #1E293B;
  background: #F1F5F9;
  border: 1px solid #CBD5E1;
  border-radius: 4px;
  white-space: nowrap;
}

.v2-designator-pill-more {
  background: #E2E8F0;
  color: #475569;
  border-color: #CBD5E1;
  cursor: help;
}

/* ========================================================================
   FORM CONTROLS: Touch-Friendly Inputs
   ======================================================================== */

.v2-input,
.v2-textarea {
  width: 100%;
  min-height: var(--touch-target-min);
  padding: 0 14px;
  font-family: var(--mms-font-sans);
  font-size: 14px;
  line-height: 1.5;
  color: var(--mms-obsidian);
  background: var(--mms-surface);
  border: 1px solid var(--mms-border);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  outline: none;
  box-sizing: border-box;
}

/* Enhanced Industrial Precision Dropdown Select */
.v2-select,
.form-select,
select.v2-input {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  width: 100%;
  min-height: var(--touch-target-min, 44px);
  padding: 0 40px 0 14px;
  font-family: var(--mms-font-sans);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--mms-obsidian);
  background-color: var(--mms-surface);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px 16px;
  border: 1.5px solid var(--mms-border, #E2E8F0);
  border-radius: var(--radius-md, 8px);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: border-color var(--transition-fast), background-color var(--transition-fast), box-shadow var(--transition-fast);
  outline: none;
  cursor: pointer;
  box-sizing: border-box;
}

.v2-select:hover,
.form-select:hover,
select.v2-input:hover {
  border-color: #94A3B8;
  background-color: #F8FAFC;
}

.v2-input:focus,
.v2-textarea:focus {
  border-color: var(--mms-brand-primary);
  box-shadow: 0 0 0 3px var(--mms-brand-primary-soft);
}

.v2-select:focus,
.form-select:focus,
select.v2-input:focus {
  border-color: var(--color-brand, #0057b8);
  background-color: #FFFFFF;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%230057b8' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  box-shadow: 0 0 0 3.5px rgba(0, 87, 184, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);
}

.v2-input:disabled,
.v2-select:disabled,
.form-select:disabled,
.v2-textarea:disabled,
select.v2-input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  background-color: var(--mms-surface-subtle);
  border-color: var(--mms-border);
}

.v2-select option,
.form-select option,
select.v2-input option {
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 500;
  color: #0F172A;
  background-color: #FFFFFF;
}

.v2-input::placeholder,
.v2-textarea::placeholder {
  color: var(--mms-obsidian-subtle);
}

.v2-textarea {
  min-height: 120px;
  padding: 12px 14px;
  resize: vertical;
}

/* Form Field Group */
.v2-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.v2-field-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--mms-obsidian);
}

.v2-field-hint {
  font-size: 12px;
  color: var(--mms-obsidian-subtle);
}

.v2-field-error {
  font-size: 12px;
  color: var(--mms-status-danger);
  font-weight: 500;
}

.v2-field.has-error .v2-input,
.v2-field.has-error .v2-select,
.v2-field.has-error .v2-textarea {
  border-color: var(--mms-status-danger);
}

.v2-field.has-error .v2-input:focus,
.v2-field.has-error .v2-select:focus,
.v2-field.has-error .v2-textarea:focus {
  box-shadow: 0 0 0 3px var(--mms-status-danger-bg);
}

/* Checkbox & Radio */
.v2-checkbox,
.v2-radio {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  min-height: var(--touch-target-min);
}

.v2-checkbox input[type="checkbox"],
.v2-checkbox-input,
.v2-radio input[type="radio"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--mms-accent-indigo);
}

.v2-checkbox label,
.v2-radio label {
  font-size: 14px;
  color: var(--mms-obsidian);
  cursor: pointer;
}

/* ========================================================================
   TABULAR DATA TABLES: Precision Typography & Sticky Headers
   ======================================================================== */

.v2-table-container {
  width: 100%;
  overflow-x: auto;
  background: var(--mms-surface);
  border: 1px solid #E2E8F0;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.v2-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  font-family: var(--mms-font-sans);
}

.v2-table thead {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #F8FAFC;
}

.v2-table th {
  padding: 12px 16px;
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #475569;
  border-bottom: 1px solid #E2E8F0;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.v2-table td {
  padding: 13px 16px;
  color: var(--mms-obsidian);
  border-bottom: 1px solid #F1F5F9;
  font-variant-numeric: tabular-nums;
}

.v2-table tbody tr {
  transition: background var(--transition-fast);
}

/* Subtle Zebra Striping */
.v2-table tbody tr:nth-child(even) {
  background: #FAFBFD;
}

/* Harmonious Soft Row Hover */
.v2-table tbody tr:hover {
  background: #F0F7FF;
  cursor: pointer;
}

/* Table Cell Alignment Utilities */
.v2-table th.text-right,
.v2-table td.text-right {
  text-align: right;
}

.v2-table th.text-center,
.v2-table td.text-center {
  text-align: center;
}

/* Numeric Column (Force Tabular Nums) */
.v2-table td.numeric,
.v2-table th.numeric {
  font-family: var(--mms-font-tabular);
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1;
}

/* Table Actions Column */
.v2-table-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
}

.v2-table-action-btn {
  padding: 6px 10px;
  font-size: 12px;
  min-height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--mms-surface-subtle);
  background: var(--mms-surface);
  color: var(--mms-obsidian-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-weight: 500;
}

.v2-table-action-btn:hover {
  background: var(--mms-surface-hover);
  color: var(--mms-obsidian);
  border-color: var(--mms-obsidian-subtle);
}

/* ========================================================================
   METRIC KPI CARDS: Dashboard Summary Tiles
   ======================================================================== */

.v2-card {
  background: var(--mms-surface);
  border: 1px solid var(--mms-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-card);
  transition: box-shadow var(--transition-fast), border-color var(--transition-fast);
}

.v2-card:hover {
  box-shadow: var(--shadow-elevated);
  border-color: var(--mms-brand-primary);
}

/* KPI Metric Card */
.v2-kpi-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.v2-kpi-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.v2-kpi-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--mms-obsidian-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.v2-kpi-icon {
  width: 20px;
  height: 20px;
  color: var(--mms-obsidian-subtle);
}

.v2-kpi-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--mms-obsidian);
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1;
}

.v2-kpi-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.v2-kpi-delta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.v2-kpi-delta.positive {
  background: var(--mms-status-success-bg);
  color: var(--mms-status-success);
}

.v2-kpi-delta.negative {
  background: var(--mms-status-danger-bg);
  color: var(--mms-status-danger);
}

.v2-kpi-delta.neutral {
  background: var(--mms-status-neutral-bg);
  color: var(--mms-status-neutral);
}

.v2-kpi-label {
  color: var(--mms-obsidian-subtle);
}

/* Card Header (Title + Action) */
.v2-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--mms-surface-subtle);
}

.v2-card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--mms-obsidian);
}

.v2-card-body {
  color: var(--mms-obsidian-muted);
  font-size: 14px;
  line-height: 1.6;
}

.v2-card-footer {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--mms-surface-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ========================================================================
   MODAL DIALOGS: Centered Overlay with Backdrop
   ======================================================================== */

.v2-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
  animation: v2-fade-in 200ms ease-out;
}

.v2-modal {
  background: var(--mms-surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-station);
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: v2-scale-in 200ms ease-out;
}

.v2-modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--mms-surface-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.v2-modal-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--mms-obsidian);
}

.v2-modal-close {
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: var(--mms-obsidian-subtle);
  cursor: pointer;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.v2-modal-close:hover {
  background: var(--mms-surface-hover);
  color: var(--mms-obsidian);
}

.v2-modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
  color: var(--mms-obsidian-muted);
  font-size: 14px;
  line-height: 1.6;
}

.v2-modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--mms-surface-subtle);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-shrink: 0;
}

/* Modal Size Variants */
.v2-modal-sm {
  max-width: 400px;
}

.v2-modal-lg {
  max-width: 800px;
}

.v2-modal-xl {
  max-width: 1200px;
}

/* Modal Animations */
@keyframes v2-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes v2-scale-in {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ========================================================================
   ALERT BANNERS: Contextual Feedback Messages
   ======================================================================== */

.v2-alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  font-size: 14px;
  line-height: 1.5;
  border: 1px solid transparent;
}

.v2-alert[hidden],
.v2-alert.hidden {
  display: none !important;
}

.v2-alert-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-top: 2px;
}

.v2-alert-content {
  flex: 1;
}

.v2-alert-title {
  font-weight: 600;
  margin-bottom: 4px;
}

.v2-alert-message {
  opacity: 0.9;
}

.v2-alert-close {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-fast);
  margin-top: -2px;
}

/* Alert Variants */
.v2-alert-success {
  background: var(--mms-status-success-bg);
  color: var(--mms-status-success);
  border-color: var(--mms-status-success-border);
}

.v2-alert-success .v2-alert-close:hover {
  background: var(--mms-status-success-border);
}

.v2-alert-warning {
  background: var(--mms-status-warning-bg);
  color: var(--mms-status-warning);
  border-color: var(--mms-status-warning-border);
}

.v2-alert-warning .v2-alert-close:hover {
  background: var(--mms-status-warning-border);
}

.v2-alert-danger {
  background: var(--mms-status-danger-bg);
  color: var(--mms-status-danger);
  border-color: var(--mms-status-danger-border);
}

.v2-alert-danger .v2-alert-close:hover {
  background: var(--mms-status-danger-border);
}

.v2-alert-info {
  background: var(--mms-status-info-bg);
  color: var(--mms-status-info);
  border-color: var(--mms-status-info-border);
}

.v2-alert-info .v2-alert-close:hover {
  background: var(--mms-status-info-border);
}

/* ========================================================================
   UTILITY CLASSES
   ======================================================================== */

/* Text Utilities */
.text-sm { font-size: 13px; }
.text-base { font-size: 14px; }
.text-lg { font-size: 16px; }
.text-xl { font-size: 18px; }
.text-2xl { font-size: 24px; }

.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.font-mono,
.font-tabular {
  font-family: var(--mms-font-tabular) !important;
  font-feature-settings: 'tnum' 1;
}

.font-sans {
  font-family: var(--mms-font-sans) !important;
}

/* Spacing Utilities */
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.ml-4 { margin-left: 16px; }
.mr-4 { margin-right: 16px; }

.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }

/* Display Utilities */
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.hidden { display: none; }

.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }

/* Screen Reader Only (Accessibility) */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ========================================================================
   === Dashboard V2 Components ===
   Dashboard-specific layout and styling for operational metrics
   ======================================================================== */

/* Universal Page Container */
.v2-page-container {
    padding: 24px 32px;
    max-width: 1680px;
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

@media (max-width: 1023px) {
  .v2-page-container {
    padding: 16px 20px;
    gap: 16px;
  }
}

@media (max-width: 639px) {
  .v2-page-container {
    padding: 12px 10px;
    gap: 14px;
  }
}

.v2-page-container > * {
    margin-bottom: 0 !important;
}

/* ========================================================================
   DASHBOARD V2: Clean, Colourful, Minimalist Industrial Command Center
   Anti-Slop Standard (COMBINED_SKILLS.md):
   - Flat border-driven depth with concentric radii
   - Purposeful semantic accents (Blue, Indigo, Purple, Emerald, Amber, Teal)
   - Tabular numerals with JetBrains Mono
   - Tactile scale(0.96) press feedback & explicit transition properties
   ======================================================================== */

/* Command Center Hero Card */
.v2-dash-hero {
  position: relative;
  background: var(--mms-surface, #FFFFFF);
  border: 1px solid var(--mms-border, #E2E8F0);
  border-radius: var(--radius-lg, 12px);
  padding: 20px 24px;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.04), 0 1px 2px 0 rgba(0, 0, 0, 0.02);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

@media (max-width: 639px) {
  .v2-dash-hero {
    padding: 16px 18px;
    gap: 14px;
  }
}

.v2-dash-hero-info {
  flex: 1;
  min-width: 240px;
}

.v2-dash-hero-title {
  font-size: clamp(20px, 2.2vw, 25px);
  font-weight: 800;
  color: var(--color-ink, #122033);
  margin: 0 0 6px 0;
  line-height: 1.25;
  letter-spacing: -0.025em;
  text-wrap: balance;
  font-family: var(--mms-font-sans, system-ui);
}

.v2-dash-hero-subtitle {
  font-size: 13.5px;
  color: #475569;
  margin: 0;
  line-height: 1.5;
  font-weight: 400;
  text-wrap: pretty;
}

.v2-dash-hero-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

@media (max-width: 639px) {
  .v2-dash-hero-actions {
    width: 100%;
  }
  .v2-dash-hero-actions > a,
  .v2-dash-hero-actions > button {
    flex: 1;
    justify-content: center;
  }
}

.v2-dash-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--color-brand, #0057b8);
  color: #FFFFFF;
  border: 1px solid var(--color-brand, #0057b8);
  border-radius: 8px;
  padding: 0 16px;
  height: 44px;
  min-height: 44px;
  font-size: 13.5px;
  font-weight: 700;
  font-family: var(--mms-font-sans, system-ui);
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 87, 184, 0.2);
  transition: background 150ms ease, border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
  white-space: nowrap;
}

.v2-dash-btn-primary:hover {
  background: var(--color-brand-strong, #00458f);
  border-color: var(--color-brand-strong, #00458f);
  box-shadow: 0 4px 12px rgba(0, 87, 184, 0.25);
  transform: translateY(-1px);
}

.v2-dash-btn-primary:active {
  transform: scale(0.96);
}

.v2-dash-btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #FFFFFF;
  color: var(--color-ink, #122033);
  border: 1px solid #D1D5DB;
  border-radius: 8px;
  padding: 0 16px;
  height: 44px;
  min-height: 44px;
  font-size: 13.5px;
  font-weight: 600;
  font-family: var(--mms-font-sans, system-ui);
  text-decoration: none;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease, transform 150ms ease, box-shadow 150ms ease;
  white-space: nowrap;
}

.v2-dash-btn-secondary:hover {
  background: #F8FAFC;
  border-color: #94A3B8;
  transform: translateY(-1px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.v2-dash-btn-secondary:active {
  transform: scale(0.96);
}

.v2-dash-refresh-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #F8FAFC;
  color: #334155;
  border: 1px solid #CBD5E1;
  border-radius: 8px;
  padding: 0 14px;
  height: 44px;
  min-height: 44px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease, transform 150ms ease;
  font-family: var(--mms-font-sans, system-ui);
}

.v2-dash-refresh-btn:hover {
  background: var(--color-brand-soft, #eff6ff);
  color: var(--color-brand, #0057b8);
  border-color: var(--color-brand-border, #bfdbfe);
}

.v2-dash-refresh-btn:active {
  transform: scale(0.96);
}

.v2-dash-refresh-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.v2-dash-refresh-btn.is-spinning svg {
  animation: v2Spin 800ms linear infinite;
}

@keyframes v2Spin {
  100% { transform: rotate(360deg); }
}

/* Tier 1: Action Priority Queue (Antrean Tindakan Operasional) */
.v2-dash-actions-section {
  margin-top: 18px;
}

.v2-dash-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.v2-dash-section-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #475569;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.v2-dash-actions-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

@media (max-width: 767px) {
  .v2-dash-actions-grid {
    grid-template-columns: 1fr;
  }
}

.v2-dash-action-card {
  position: relative;
  background: #FFFFFF;
  border-radius: 12px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease;
  min-height: 140px;
  text-decoration: none;
}

.v2-dash-action-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px -3px rgba(0, 0, 0, 0.08);
}

.v2-dash-action-card.v2-action-amber {
  border: 1.5px solid #FCD34D;
  background: linear-gradient(180deg, #FFFDF7 0%, #FFFFFF 100%);
}

.v2-dash-action-card.v2-action-amber:hover {
  border-color: #F59E0B;
}

.v2-dash-action-card.v2-action-indigo {
  border: 1.5px solid #C7D2FE;
  background: linear-gradient(180deg, #F8FAFF 0%, #FFFFFF 100%);
}

.v2-dash-action-card.v2-action-indigo:hover {
  border-color: #6366F1;
}

.v2-dash-action-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.v2-dash-action-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.v2-action-amber .v2-dash-action-badge {
  background: #FEF3C7;
  color: #B45309;
  border: 1px solid #FDE68A;
}

.v2-action-indigo .v2-dash-action-badge {
  background: #EEF2FF;
  color: #4338CA;
  border: 1px solid #E0E7FF;
}

.v2-dash-action-badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.v2-dash-action-val {
  font-family: var(--mms-font-tabular, 'JetBrains Mono', monospace);
  font-size: 32px;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.v2-action-amber .v2-dash-action-val {
  color: #B45309;
}

.v2-action-indigo .v2-dash-action-val {
  color: #4338CA;
}

.v2-dash-action-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.v2-dash-action-title {
  font-size: 15px;
  font-weight: 700;
  color: #0F172A;
  margin: 0;
}

.v2-dash-action-desc {
  font-size: 12.5px;
  color: #475569;
  line-height: 1.45;
  margin: 0;
}

.v2-dash-action-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px solid #F1F5F9;
  margin-top: 4px;
}

.v2-dash-action-link {
  font-size: 12.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}

.v2-action-amber .v2-dash-action-link {
  color: #D97706;
}

.v2-action-amber .v2-dash-action-link:hover {
  color: #B45309;
  text-decoration: underline;
}

.v2-action-indigo .v2-dash-action-link {
  color: var(--color-brand, #0057b8);
}

.v2-action-indigo .v2-dash-action-link:hover {
  color: var(--color-brand-strong, #00458f);
  text-decoration: underline;
}

/* Tier 2: Passive Operational Telemetry (Metrik Pemantauan Tenang) */
.v2-dash-monitor-section {
  margin-top: 16px;
}

.v2-dash-monitor-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

@media (max-width: 1023px) {
  .v2-dash-monitor-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 639px) {
  .v2-dash-monitor-grid {
    grid-template-columns: 1fr;
  }
}

.v2-dash-monitor-card {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
  min-height: 108px;
}

.v2-dash-monitor-card:hover {
  border-color: #94A3B8;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  transform: translateY(-1px);
}

.v2-dash-monitor-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.v2-dash-monitor-label {
  font-size: 11.5px;
  font-weight: 600;
  color: #64748B;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.v2-dash-monitor-icon {
  color: #94A3B8;
  display: flex;
  align-items: center;
}

.v2-dash-monitor-val {
  font-family: var(--mms-font-tabular, 'JetBrains Mono', monospace);
  font-size: 22px;
  font-weight: 800;
  color: #0F172A;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.v2-dash-monitor-sub {
  font-size: 11.5px;
  color: #64748B;
  line-height: 1.35;
  display: flex;
  align-items: center;
  gap: 6px;
}

.v2-dash-monitor-badge-safe {
  color: #059669;
  font-weight: 600;
}

/* Structured Part Distribution Table/Rows */
.v2-dash-flow-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.v2-dash-flow-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  transition: background 150ms ease, border-color 150ms ease;
}

.v2-dash-flow-row:hover {
  background: #FFFFFF;
  border-color: #CBD5E1;
}

.v2-dash-flow-row-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.v2-dash-flow-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
}

.v2-dash-flow-cat-name {
  font-size: 13px;
  font-weight: 700;
  color: #0F172A;
  white-space: nowrap;
}

.v2-dash-flow-spec {
  font-size: 11.5px;
  color: #64748B;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.v2-dash-flow-row-right {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-shrink: 0;
}

.v2-dash-flow-count-num {
  font-family: var(--mms-font-tabular, 'JetBrains Mono', monospace);
  font-size: 15px;
  font-weight: 700;
  color: #0F172A;
}

.v2-dash-flow-count-pct {
  font-size: 11.5px;
  color: #64748B;
  font-weight: 500;
}

/* Enhanced Precision Telemetry Trend & Matrix */
.v2-dash-telemetry-status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 6px;
  padding: 8px 14px;
  margin-top: 6px;
  font-size: 12px;
  font-weight: 500;
  color: #64748B;
  width: 100%;
  box-sizing: border-box;
}

.v2-dash-telemetry-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #05B169;
  box-shadow: 0 0 0 2px rgba(5, 177, 105, 0.2);
  animation: v2PulseDot 2s infinite ease-in-out;
  flex-shrink: 0;
}

@keyframes v2PulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.85); }
}

.v2-dash-trend-matrix {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  margin-top: 10px;
  overflow: hidden;
}

@media (max-width: 639px) {
  .v2-dash-trend-matrix {
    grid-template-columns: 1fr;
  }
}

.v2-dash-matrix-col {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-right: 1px solid #F1F5F9;
  transition: background 150ms ease;
}

@media (max-width: 639px) {
  .v2-dash-matrix-col {
    border-right: none;
    border-bottom: 1px solid #F1F5F9;
  }
}

.v2-dash-matrix-col:last-child {
  border-right: none;
  border-bottom: none;
}

.v2-dash-matrix-col.is-today {
  background: #F8FAFC;
}

.v2-dash-matrix-col:hover {
  background: #F1F5F9;
}

.v2-dash-matrix-date {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  font-weight: 700;
  color: #475569;
  padding-bottom: 6px;
  border-bottom: 1px solid #F1F5F9;
}

.v2-dash-matrix-today-tag {
  font-size: 9px;
  font-weight: 700;
  color: var(--color-brand, #0057b8);
  background: var(--color-brand-soft, #eff6ff);
  border: 1px solid var(--color-brand-border, #bfdbfe);
  padding: 1px 4px;
  border-radius: 4px;
  line-height: 1.1;
  text-transform: uppercase;
}

.v2-dash-matrix-metrics {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.v2-dash-matrix-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
}

.v2-dash-matrix-label {
  color: #94A3B8;
  font-weight: 500;
}

.v2-dash-matrix-val {
  font-family: var(--mms-font-tabular, 'JetBrains Mono', monospace);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.v2-dash-workflow-step {
  font-family: var(--mms-font-tabular, 'JetBrains Mono', monospace);
  font-size: 12px;
  font-weight: 800;
  color: var(--color-brand, #0057b8);
  background: var(--color-brand-soft, #eff6ff);
  border: 1px solid var(--color-brand-border, #bfdbfe);
  border-radius: 6px;
  padding: 4px 7px;
  line-height: 1;
  flex-shrink: 0;
}

.v2-dash-workflow-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.v2-dash-workflow-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #0F172A;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.v2-dash-workflow-desc {
  font-size: 11.5px;
  color: #64748B;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.v2-dash-workflow-arrow {
  color: #94A3B8;
  flex-shrink: 0;
  transition: transform 150ms ease, color 150ms ease;
}

.v2-dash-workflow-card:hover .v2-dash-workflow-arrow {
  color: var(--color-brand, #0057b8);
  transform: translateX(2px);
}

/* 6-Card KPI Grid: Adaptive across all screen resolutions */
.v2-dash-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

@media (min-width: 1536px) {
  .v2-dash-kpi-grid {
    grid-template-columns: repeat(6, 1fr);
  }
}

@media (min-width: 1024px) and (max-width: 1535px) {
  .v2-dash-kpi-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 640px) and (max-width: 1023px) {
  .v2-dash-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 639px) {
  .v2-dash-kpi-grid {
    grid-template-columns: 1fr;
  }
}

.v2-dash-kpi-card {
  position: relative;
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  text-decoration: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03), 0 1px 2px rgba(0, 0, 0, 0.02);
  transition: border-color 150ms ease, transform 150ms ease, box-shadow 150ms ease;
  cursor: pointer;
  min-width: 0;
  overflow: hidden;
}

.v2-dash-kpi-card:hover {
  border-color: var(--card-accent, var(--color-brand, #0057b8));
  transform: translateY(-2px);
  box-shadow: 0 6px 16px -2px rgba(0, 0, 0, 0.08);
}

.v2-dash-kpi-card:active {
  transform: scale(0.98);
}

.v2-dash-kpi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.v2-dash-kpi-label {
  font-size: 11.5px;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: normal;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
}

.v2-dash-kpi-icon-box {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--card-accent-bg, var(--color-brand-soft, #ebf3fb));
  color: var(--card-accent, var(--color-brand, #0057b8));
  border: 1px solid var(--card-accent-border, var(--color-brand-border, #b8d4f2));
}

.v2-dash-kpi-value {
  font-family: var(--mms-font-tabular, 'JetBrains Mono', monospace);
  font-size: clamp(24px, 2vw, 28px);
  font-weight: 800;
  color: var(--color-ink, #122033);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.v2-dash-kpi-zero-hint {
  font-size: 11.5px;
  color: #64748B;
  font-style: normal;
  line-height: 1.3;
  margin-top: 2px;
}

.v2-dash-kpi-meta {
  font-size: 12px;
  color: #475569;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  border-top: 1px solid #F1F5F9;
  padding-top: 10px;
  flex-wrap: wrap;
}

/* Card Themes */
.v2-card-blue {
  --card-accent: var(--color-brand, #0057b8);
  --card-accent-bg: var(--color-brand-soft, #ebf3fb);
  --card-accent-border: var(--color-brand-border, #b8d4f2);
}

.v2-card-indigo {
  --card-accent: #1e3a8a;
  --card-accent-bg: #eff6ff;
  --card-accent-border: #bfdbfe;
}

.v2-card-purple {
  --card-accent: #334155;
  --card-accent-bg: #f1f5f9;
  --card-accent-border: #cbd5e1;
}

.v2-card-emerald {
  --card-accent: #047857;
  --card-accent-bg: #E6F6EF;
  --card-accent-border: #A3E5C7;
}

.v2-card-amber {
  --card-accent: #D97706;
  --card-accent-bg: #FEF3C7;
  --card-accent-border: #FDE68A;
}

.v2-card-teal {
  --card-accent: #0D9488;
  --card-accent-bg: #F0FDFA;
  --card-accent-border: #99F6E4;
}

/* Dual Grid Section (Left: Flows & Shift, Right: 5-Day Trend Analytics) */
.v2-dash-dual-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  margin-top: 18px;
}

@media (min-width: 1024px) {
  .v2-dash-dual-grid {
    grid-template-columns: 1.15fr 1fr;
  }
}

.v2-dash-panel {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  padding: 20px 22px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
  overflow: hidden;
}

.v2-dash-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #F1F5F9;
  flex-wrap: wrap;
}

.v2-dash-panel-title {
  font-size: 15.5px;
  font-weight: 700;
  color: var(--color-ink, #122033);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.v2-dash-panel-subtitle {
  font-size: 12.5px;
  color: #475569;
  margin: 2px 0 0 0;
}

/* 4-Flow Segmented Distribution Bar */
.v2-dash-flow-bar-container {
  margin-bottom: 16px;
}

.v2-dash-flow-segmented-bar {
  display: flex;
  height: 10px;
  border-radius: 5px;
  overflow: hidden;
  background: #F1F5F9;
  margin-bottom: 12px;
  gap: 2px;
}

.v2-dash-flow-seg {
  height: 100%;
  transition: width 300ms ease;
  min-width: 4px;
}

.v2-dash-flow-seg-smt { background: var(--color-brand, #0057b8); }
.v2-dash-flow-seg-axl { background: #05B169; }
.v2-dash-flow-seg-rhs { background: #F59E0B; }
.v2-dash-flow-seg-pcb { background: #475569; }

.v2-dash-flow-chips {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
}

.v2-dash-flow-chip {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #E2E8F0;
  background: #F9FAFB;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: border-color 150ms ease, background 150ms ease;
  min-width: 0;
}

.v2-dash-flow-chip:hover {
  background: #FFFFFF;
  border-color: #CBD5E1;
}

.v2-dash-flow-name {
  font-size: 11px;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
}

.v2-dash-flow-count {
  font-family: var(--mms-font-tabular, 'JetBrains Mono', monospace);
  font-size: 16px;
  font-weight: 700;
  color: var(--color-ink, #122033);
}

.v2-dash-flow-spq {
  font-size: 11px;
  color: #64748B;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Shift Info Card */
.v2-dash-shift-box {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  padding: 14px 16px;
  margin-top: 12px;
}

.v2-dash-shift-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.v2-dash-shift-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #EFF6FF;
  border: 1px solid #BFDBFE;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--color-brand, #0057b8);
}

.v2-dash-shift-metrics-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(85px, 1fr));
  gap: 10px;
}

.v2-dash-shift-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.v2-dash-shift-stat-label {
  font-size: 11px;
  font-weight: 600;
  color: #475569;
  text-transform: uppercase;
}

.v2-dash-shift-stat-val {
  font-family: var(--mms-font-tabular, 'JetBrains Mono', monospace);
  font-size: 17px;
  font-weight: 700;
  color: var(--color-ink, #122033);
}

.v2-val-good { color: #047857; }
.v2-val-reject { color: #DF2935; }
.v2-val-yield { color: var(--color-brand, #0057b8); }

/* SVG Vector Chart Container */
.v2-dash-chart-container {
  width: 100%;
  position: relative;
  margin-top: 12px;
  background: #FAFCFF;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  padding: 16px 14px 10px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 180px;
  box-sizing: border-box;
}

.v2-dash-svg-chart {
  width: 100%;
  height: 100%;
  min-height: 150px;
  max-height: 220px;
  display: block;
}

.v2-dash-chart-daily-pills {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin-top: 10px;
}

@media (max-width: 639px) {
  .v2-dash-chart-daily-pills {
    grid-template-columns: repeat(auto-fit, minmax(65px, 1fr));
  }
}

.v2-dash-chart-pill {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 6px;
  padding: 6px 8px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.v2-dash-chart-pill-date {
  font-size: 11px;
  font-weight: 600;
  color: #475569;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.v2-dash-chart-pill-val-c {
  font-family: var(--mms-font-tabular, 'JetBrains Mono', monospace);
  font-size: 12px;
  font-weight: 700;
  color: var(--color-brand, #0057b8);
}

.v2-dash-chart-pill-val-p {
  font-family: var(--mms-font-tabular, 'JetBrains Mono', monospace);
  font-size: 11px;
  font-weight: 700;
  color: #047857;
}

.v2-chart-legend {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 12px;
  color: #475569;
  margin-bottom: 6px;
}

.v2-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.v2-legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.v2-dot-consumed { background: var(--color-brand, #0057b8); }
.v2-dot-produced { background: #05B169; }

/* Shopfloor Quick Station Launchpad */
.v2-dash-stations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin-top: 14px;
}

@media (min-width: 1400px) {
  .v2-dash-stations-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (min-width: 640px) and (max-width: 1399px) {
  .v2-dash-stations-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 639px) {
  .v2-dash-stations-grid {
    grid-template-columns: 1fr;
  }
}

.v2-dash-station-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  text-decoration: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  transition: border-color 150ms ease, transform 150ms ease, box-shadow 150ms ease;
  min-height: 72px;
  min-width: 0;
  overflow: hidden;
}

.v2-dash-station-card:hover {
  border-color: var(--station-color, var(--color-brand, #0057b8));
  transform: translateY(-2px);
  box-shadow: 0 6px 16px -2px rgba(0, 0, 0, 0.08);
}

.v2-dash-station-card:active {
  transform: scale(0.96);
}

.v2-dash-station-icon-box {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--station-bg, var(--color-brand-soft, #ebf3fb));
  color: var(--station-color, var(--color-brand, #0057b8));
  flex-shrink: 0;
}

.v2-dash-station-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  overflow: hidden;
}

.v2-dash-station-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-ink, #122033);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.v2-dash-station-desc {
  font-size: 12px;
  color: #475569;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.v2-dash-station-arrow {
  color: #94A3B8;
  flex-shrink: 0;
  transition: transform 150ms ease, color 150ms ease;
}

.v2-dash-station-card:hover .v2-dash-station-arrow {
  color: var(--station-color, var(--color-brand, #0057b8));
  transform: translateX(3px);
}

/* Low Stock Table Section */
.v2-dash-table-card {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  margin-top: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  overflow: hidden;
}

.v2-dash-table-header {
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #F1F5F9;
  flex-wrap: wrap;
  gap: 12px;
}

.v2-dash-table-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-ink, #122033);
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
}

.v2-dash-meter-container {
  width: 100%;
  max-width: 120px;
  height: 6px;
  background: #FEE2E2;
  border-radius: 3px;
  overflow: hidden;
  margin-top: 4px;
}

.v2-dash-meter-bar {
  height: 100%;
  background: #DF2935;
  border-radius: 3px;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .v2-page-container {
        padding: 16px;
    }

    .v2-operational-hero {
        padding: 24px;
    }

    .v2-hero-title {
        font-size: 22px;
    }

    .v2-hero-subtitle {
        font-size: 14px;
    }

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

    .v2-shift-info {
        flex-direction: column;
        align-items: flex-start;
    }

    .v2-production-metrics {
        width: 100%;
        justify-content: space-between;
    }
    
    .v2-machine-summary {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Tabular Numerals Utility */
.tabular-nums {
    font-variant-numeric: tabular-nums;
    font-feature-settings: 'tnum' 1;
}

/* Badge size and spacing utility */
.v2-badge-sm-inline {
  font-size: 13px;
  margin-left: 8px;
}

/* ========================================================================
   TAB NAVIGATION: Interactive Horizontal Tabs (≥44px Touch Targets)
   ======================================================================== */

.v2-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 2px solid var(--mms-surface-subtle);
  margin-bottom: 24px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.v2-tab-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--touch-target-min);
  padding: 0 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--mms-obsidian-muted);
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  text-decoration: none;
  position: relative;
  margin-bottom: -2px;
}

.v2-tab-item:hover {
  color: var(--mms-obsidian);
  background: var(--mms-surface-hover);
  border-bottom-color: var(--mms-obsidian-subtle);
}

.v2-tab-item.active {
  color: var(--mms-brand-primary);
  border-bottom-color: var(--mms-brand-primary);
  font-weight: 600;
}

.v2-tab-item.active:hover {
  background: transparent;
}

.v2-tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  font-size: 11px;
  font-weight: 600;
  background: var(--mms-surface-subtle);
  color: var(--mms-obsidian-muted);
  border-radius: 12px;
  font-variant-numeric: tabular-nums;
}

.v2-tab-item.active .v2-tab-badge {
  background: var(--mms-brand-primary-soft);
  color: var(--mms-brand-primary);
}

/* ========================================================================
   FILTER CHIPS: Interactive Category Filters (≥44px Touch Targets)
   ======================================================================== */

.v2-chip-group {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.v2-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 18px;
  font-size: 13px;
  font-weight: 500;
  color: var(--mms-obsidian-muted);
  background: var(--mms-surface);
  border: 1px solid var(--mms-surface-subtle);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  user-select: none;
}

.v2-chip:hover {
  background: var(--mms-surface-hover);
  border-color: var(--mms-obsidian-subtle);
  color: var(--mms-obsidian);
}

.v2-chip.active {
  background: var(--mms-brand-primary);
  color: white;
  border-color: var(--mms-brand-primary);
  font-weight: 600;
}

.v2-chip.active:hover {
  background: var(--mms-brand-primary-hover);
  border-color: var(--mms-brand-primary-hover);
}

.v2-chip-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  font-size: 11px;
  font-weight: 600;
  background: var(--mms-surface-subtle);
  color: var(--mms-obsidian-muted);
  border-radius: 10px;
  font-variant-numeric: tabular-nums;
}

.v2-chip.active .v2-chip-count {
  background: rgba(255, 255, 255, 0.25);
  color: white;
}

/* ========================================================================
   SEARCH TOOLBAR: Inline Search Form with Actions
   ======================================================================== */

.v2-search-toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 20px;
  padding: 16px;
  background: var(--mms-surface);
  border: 1px solid var(--mms-surface-subtle);
  border-radius: var(--radius-lg);
}

.v2-search-input-group {
  flex: 1;
  min-width: 280px;
  display: flex;
  gap: 8px;
}

.v2-search-input-group .v2-input {
  flex: 1;
}

.v2-search-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ========================================================================
   EMPTY STATE: No Results / No Data Messaging
   ======================================================================== */

.v2-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 60px 24px;
  text-align: center;
  color: var(--mms-obsidian-subtle);
}

.v2-empty-icon {
  width: 64px;
  height: 64px;
  color: var(--mms-obsidian-subtle);
  opacity: 0.4;
}

.v2-empty-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--mms-obsidian-muted);
  margin: 0;
}

.v2-empty-message {
  font-size: 14px;
  color: var(--mms-obsidian-subtle);
  margin: 0;
  max-width: 400px;
  line-height: 1.6;
}

.v2-empty-action {
  margin-top: 8px;
}

/* ========================================================================
   METRICS SUMMARY BAR: Inline KPI Display
   ======================================================================== */

.v2-metrics-bar {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  padding: 20px;
  background: var(--mms-surface);
  border: 1px solid var(--mms-surface-subtle);
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
}

.v2-metric-inline {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 120px;
}

.v2-metric-inline-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--mms-obsidian-subtle);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.v2-metric-inline-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--mms-obsidian);
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1;
}

.v2-metric-inline-unit {
  font-size: 14px;
  font-weight: 500;
  color: var(--mms-obsidian-muted);
  margin-left: 4px;
}

/* ========================================================================
   REPORTS OPTION TILES: Minimalist Button Options Grid
   ======================================================================== */

.v2-report-tile {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: var(--mms-surface);
  border: 1px solid var(--mms-border);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: var(--mms-obsidian);
  box-shadow: var(--shadow-xs);
  transition: all var(--transition-fast);
  cursor: pointer;
  position: relative;
  min-height: 64px;
}

.v2-report-tile:hover {
  background: var(--mms-surface-hover);
  border-color: var(--mms-brand-primary-border);
  box-shadow: 0 4px 12px rgba(0, 64, 152, 0.08);
  transform: translateY(-1px);
}

.v2-report-tile:hover .v2-report-tile-title {
  color: var(--mms-brand-primary);
}

.v2-report-tile:hover .v2-report-tile-icon {
  background: var(--mms-brand-primary-soft);
  color: var(--mms-brand-primary);
  border-color: var(--mms-brand-primary-border);
}

.v2-report-tile:hover .v2-report-tile-arrow {
  color: var(--mms-brand-primary);
  transform: translateX(3px);
}

.v2-report-tile-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: var(--mms-surface-subtle);
  border: 1px solid var(--mms-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--mms-obsidian-muted);
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.v2-report-tile-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.v2-report-tile-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--mms-obsidian);
  letter-spacing: var(--mms-tracking-tight);
  transition: color var(--transition-fast);
}

.v2-report-tile-tag {
  font-size: 12px;
  color: var(--mms-obsidian-subtle);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.v2-report-tile-arrow {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--mms-obsidian-faint);
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

/* ========================================================================
   KITTING-SPECIFIC UTILITIES
   ======================================================================== */

.v2-status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
}

.v2-status-dot.ready {
  background: var(--mms-status-success);
}

.v2-status-dot.waiting {
  background: var(--mms-status-warning);
}

.v2-status-dot.staging {
  background: var(--mms-status-info);
}

.v2-status-dot.unavailable {
  background: var(--mms-status-neutral);
}

/* Responsive Table Actions for Mobile */
@media (max-width: 768px) {
  .v2-table-actions {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .v2-table-action-btn {
    width: 100%;
    justify-content: center;
  }

  .v2-search-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .v2-search-input-group {
    min-width: 100%;
  }

  .v2-search-actions {
    width: 100%;
  }

  .v2-search-actions .v2-btn {
    flex: 1;
  }

  .v2-metrics-bar {
    gap: 16px;
  }

  .v2-metric-inline {
    min-width: calc(50% - 8px);
  }
}

/* ========================================================================
   TEXT UTILITY CLASSES: Spacing & Typography Helpers
   ======================================================================== */

/* Page subtitle text (under page headers) */
.v2-page-subtitle {
  margin-top: 4px;
  color: var(--mms-obsidian-muted);
}

/* Secondary text with spacing (descriptions, details) */
.v2-text-description {
  margin-top: 4px;
  font-size: 12px;
  color: var(--mms-obsidian-muted);
}

/* Tertiary text with spacing (quantity details, small notes) */
.v2-text-quantity-detail {
  margin-top: 4px;
  font-size: 11px;
  color: var(--mms-obsidian-subtle);
}

/* Time display text (timestamps, time info) */
.v2-text-time {
  margin-top: 2px;
  font-size: 12px;
  color: var(--mms-obsidian-subtle);
}

/* ========================================================================
   WEEKLY PLANS & PLANNING STYLES: Management, Grouping & Bulk Actions
   ======================================================================== */

.v2-plan-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.v2-plan-header-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--mms-obsidian);
  margin: 0 0 4px 0;
  letter-spacing: -0.01em;
}

.v2-plan-header-subtitle {
  font-size: 14px;
  color: var(--mms-obsidian-muted);
  margin: 0;
}

.v2-plan-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Dropdown Menu (Accessible native details/summary) */
.v2-dropdown {
  position: relative;
  display: inline-block;
}

.v2-dropdown summary {
  list-style: none;
}

.v2-dropdown summary::-webkit-details-marker {
  display: none;
}

.v2-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 220px;
  background: var(--mms-surface);
  border: 1px solid var(--mms-surface-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-elevated);
  padding: 6px 0;
  z-index: 100;
}

.v2-dropdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  font-size: 13px;
  color: var(--mms-obsidian);
  text-decoration: none;
  transition: background var(--transition-fast);
  font-variant-numeric: tabular-nums;
}

.v2-dropdown-item:hover {
  background: var(--mms-surface-hover);
  color: var(--mms-accent-indigo);
}

/* Filter Toolbar */
.v2-filter-toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.v2-filter-search-box {
  flex: 2;
  min-width: 260px;
}

.v2-filter-select-box {
  flex: 1;
  min-width: 220px;
}

.v2-filter-check-box {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  cursor: pointer;
}

.v2-filter-count-label {
  margin-left: auto;
  font-size: 13px;
  color: var(--mms-obsidian-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Bulk Action Toolbar */
.v2-bulk-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: var(--mms-surface);
  border: 1px solid var(--color-line, #E2E8F0);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  margin-bottom: 20px;
  gap: 16px;
  flex-wrap: wrap;
}

.v2-bulk-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.v2-bulk-desc {
  font-size: 13px;
  color: var(--mms-obsidian-muted);
}

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

/* Collapsible Week Group */
.v2-week-group {
  background: var(--mms-surface);
  border: 1px solid var(--mms-surface-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  margin-bottom: 20px;
  overflow: hidden;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.v2-week-group[open] {
  border-color: var(--mms-obsidian-subtle);
}

.v2-week-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--mms-surface-subtle);
  border-bottom: 1px solid transparent;
  cursor: pointer;
  user-select: none;
  gap: 16px;
  flex-wrap: wrap;
  list-style: none;
  transition: background var(--transition-fast);
}

.v2-week-summary::-webkit-details-marker {
  display: none;
}

.v2-week-group[open] .v2-week-summary {
  border-bottom-color: var(--mms-surface-subtle);
  background: var(--mms-surface);
}

.v2-week-summary:hover {
  background: var(--mms-surface-hover);
}

.v2-week-title-area {
  display: flex;
  align-items: center;
  gap: 12px;
}

.v2-week-chevron {
  width: 18px;
  height: 18px;
  color: var(--mms-obsidian-subtle);
  transition: transform var(--transition-fast);
  flex-shrink: 0;
}

.v2-week-group[open] .v2-week-chevron {
  transform: rotate(90deg);
}

.v2-week-date-label {
  font-size: 15px;
  font-weight: 600;
  color: var(--mms-obsidian);
  font-variant-numeric: tabular-nums;
  display: flex;
  align-items: center;
  gap: 8px;
}

.v2-week-meta-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.v2-week-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

@media (max-width: 768px) {
  .v2-plan-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .v2-filter-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .v2-filter-count-label {
    margin-left: 0;
  }

  .v2-bulk-bar {
    flex-direction: column;
    align-items: flex-start;
  }

  .v2-bulk-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .v2-week-summary {
    flex-direction: column;
    align-items: flex-start;
  }

  .v2-week-actions {
    margin-left: 0;
    width: 100%;
    justify-content: flex-end;
  }
}

/* ========================================================================
   REEL & BOX INVENTORY STYLES: Part Grouping, Pagination & Batch Forms
   ======================================================================== */

.v2-reel-group {
  background: var(--mms-surface);
  border: 1px solid var(--mms-surface-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  margin-bottom: 16px;
  overflow: hidden;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.v2-reel-group[open] {
  border-color: var(--mms-obsidian-subtle);
}

.v2-reel-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: var(--mms-surface-subtle);
  border-bottom: 1px solid transparent;
  cursor: pointer;
  user-select: none;
  gap: 16px;
  flex-wrap: wrap;
  list-style: none;
  transition: background var(--transition-fast);
}

.v2-reel-summary::-webkit-details-marker {
  display: none;
}

.v2-reel-group[open] .v2-reel-summary {
  border-bottom-color: var(--mms-surface-subtle);
  background: var(--mms-surface);
}

.v2-reel-summary:hover {
  background: var(--mms-surface-hover);
}

.v2-reel-title-area {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.v2-reel-chevron {
  width: 18px;
  height: 18px;
  color: var(--mms-obsidian-subtle);
  transition: transform var(--transition-fast);
  flex-shrink: 0;
}

.v2-reel-group[open] .v2-reel-chevron {
  transform: rotate(90deg);
}

.v2-reel-part-number {
  font-size: 15px;
  font-weight: 700;
  color: var(--mms-accent-indigo);
  font-family: var(--mms-font-tabular);
  letter-spacing: -0.01em;
}

.v2-reel-meta-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.v2-reel-stats {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  margin-left: auto;
}

.v2-reel-stat-label {
  color: var(--mms-obsidian-muted);
}

.v2-reel-stat-val {
  font-weight: 600;
  color: var(--mms-obsidian);
  font-family: var(--mms-font-tabular);
}

.v2-reel-stat-val.highlight {
  color: var(--mms-status-success);
}

/* Pagination Bar */
.v2-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  gap: 16px;
  flex-wrap: wrap;
}

.v2-pagination-info {
  font-size: 13px;
  color: var(--mms-obsidian-muted);
  font-variant-numeric: tabular-nums;
}

.v2-pagination-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.v2-pagination-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--touch-target-min);
  padding: 0 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--mms-obsidian);
  background: var(--mms-surface);
  border: 1px solid var(--mms-surface-subtle);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: all var(--transition-fast);
}

.v2-pagination-btn:hover:not(.disabled) {
  background: var(--mms-surface-hover);
  border-color: var(--mms-obsidian-subtle);
  color: var(--mms-accent-indigo);
}

.v2-pagination-btn.disabled {
  opacity: 0.45;
  pointer-events: none;
  cursor: not-allowed;
}

.v2-pagination-current {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--touch-target-min);
  padding: 0 16px;
  font-size: 13px;
  font-weight: 600;
  background: var(--mms-accent-indigo);
  color: white;
  border-radius: var(--radius-md);
  font-variant-numeric: tabular-nums;
}

/* Form Container & Step Badge for Batch Registration */
.v2-form-container {
  max-width: 840px;
  margin: 0 auto;
}

.v2-step-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 9999px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--mms-accent-indigo-soft);
  color: var(--mms-accent-indigo);
}

.v2-form-card {
  background: var(--mms-surface);
  border: 1px solid var(--mms-surface-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  margin-bottom: 24px;
}

.v2-form-card-header {
  padding: 20px 24px;
  background: var(--mms-surface-subtle);
  border-bottom: 1px solid var(--mms-surface-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.v2-form-card-body {
  padding: 24px;
}

.v2-form-card-footer {
  padding: 16px 24px;
  background: var(--mms-surface-subtle);
  border-top: 1px solid var(--mms-surface-subtle);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.v2-form-field {
  margin-bottom: 20px;
}

.v2-form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--mms-obsidian);
  margin-bottom: 6px;
}

.v2-form-hint {
  font-size: 12px;
  color: var(--mms-obsidian-muted);
  margin-top: 6px;
}

.v2-qr-code-display {
  font-family: var(--mms-font-tabular);
  font-weight: 700;
  color: var(--mms-accent-indigo);
  letter-spacing: 0.02em;
}

.font-tabular {
  font-family: var(--mms-font-tabular);
  font-variant-numeric: tabular-nums;
}

.v2-w-full {
  width: 100%;
}

.v2-w-checkbox {
  width: 44px;
  text-align: center;
}

.v2-w-num {
  width: 140px;
}

@media (max-width: 768px) {
  .v2-reel-stats {
    margin-left: 0;
    width: 100%;
    justify-content: space-between;
  }

  .v2-pagination {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }

  .v2-pagination-controls {
    justify-content: center;
  }
}

/* Master Data & General Utility Classes */
.v2-inline-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.text-danger {
  color: var(--mms-status-danger) !important;
}

.text-muted {
  color: var(--mms-obsidian-muted) !important;
}

.text-dark {
  color: var(--mms-obsidian) !important;
}

.text-success {
  color: var(--mms-status-success) !important;
}

/* ========================================================================
   MULTI-SELECT DROPDOWN CHECKBOX & ACTIVE FILTER CHIPS
   ======================================================================== */

.v2-multiselect-dropdown {
  position: relative;
  display: inline-block;
  min-width: 220px;
}

.v2-multiselect-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: var(--touch-target-min, 44px);
  padding: 0 14px;
  background-color: var(--mms-surface, #FFFFFF);
  border: 1.5px solid var(--mms-border, #E2E8F0);
  border-radius: var(--radius-md, 8px);
  font-family: var(--mms-font-sans);
  font-size: 14px;
  font-weight: 500;
  color: var(--mms-obsidian, #0F172A);
  text-align: left;
  cursor: pointer;
  transition: all var(--transition-fast, 0.15s ease);
  user-select: none;
}

.v2-multiselect-trigger:hover {
  border-color: #94A3B8;
  background-color: #F8FAFC;
}

.v2-multiselect-trigger[aria-expanded="true"] {
  border-color: var(--color-brand, #0057b8);
  box-shadow: 0 0 0 3px rgba(0, 87, 184, 0.15);
}

.v2-multiselect-chevron {
  transition: transform 0.2s ease;
  flex-shrink: 0;
  color: #64748B;
}

.v2-multiselect-trigger[aria-expanded="true"] .v2-multiselect-chevron {
  transform: rotate(180deg);
  color: var(--color-brand, #0057b8);
}

.v2-multiselect-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 150;
  min-width: 320px;
  max-width: 380px;
  background: #FFFFFF;
  border: 1px solid var(--mms-border, #E2E8F0);
  border-radius: var(--radius-lg, 12px);
  box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.15), 0 8px 10px -6px rgba(15, 23, 42, 0.1);
  padding: 8px 0;
  animation: v2DropdownFadeIn 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes v2DropdownFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.v2-multiselect-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px 10px;
  border-bottom: 1px solid var(--mms-surface-subtle, #F1F5F9);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #64748B;
  text-transform: uppercase;
}

.v2-multiselect-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.v2-multiselect-action-btn {
  background: none;
  border: none;
  padding: 0;
  font-size: 11px;
  font-weight: 600;
  color: var(--color-brand, #0057b8);
  cursor: pointer;
  text-decoration: underline;
}

.v2-multiselect-action-btn:hover {
  color: var(--color-brand-strong, #00458f);
}

.v2-multiselect-options {
  padding: 6px 8px;
  max-height: 280px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.v2-multiselect-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-md, 8px);
  cursor: pointer;
  transition: background var(--transition-fast, 0.15s ease);
}

.v2-multiselect-option:hover {
  background: #F8FAFC;
}

.v2-multiselect-option input[type="checkbox"] {
  margin-top: 3px;
  width: 16px;
  height: 16px;
  border-radius: 4px;
  accent-color: var(--color-brand, #0057b8);
  cursor: pointer;
}

.v2-multiselect-option-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.v2-multiselect-option-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.v2-multiselect-option-desc {
  font-size: 11px;
  color: #64748B;
  line-height: 1.3;
}

.v2-multiselect-footer {
  padding: 8px 12px 4px;
  border-top: 1px solid var(--mms-surface-subtle, #F1F5F9);
}

/* Active Filter Chips */
.v2-active-filter-chips {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.v2-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px 4px 10px;
  background: #F1F5F9;
  border: 1px solid #CBD5E1;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  color: #1E293B;
  text-decoration: none;
  transition: all var(--transition-fast, 0.15s ease);
}

.v2-filter-chip:hover {
  background: #E2E8F0;
  border-color: #94A3B8;
  color: #0F172A;
}

.v2-filter-chip-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #CBD5E1;
  color: #475569;
  font-size: 10px;
  transition: background 0.15s ease, color 0.15s ease;
}

.v2-filter-chip:hover .v2-filter-chip-remove {
  background: #94A3B8;
  color: #FFFFFF;
}

/* Category breakdown strip inside KPI card */
.v2-category-breakdown-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--mms-surface-subtle, #F1F5F9);
}

.v2-category-pill-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 12px;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  transition: all 0.15s ease;
}

.v2-category-pill-card.active-filter {
  background: #EFF6FF;
  border-color: #93C5FD;
}


.text-warning {
  color: var(--mms-status-warning) !important;
}

.v2-text-xs {
  font-size: 12px;
  line-height: 1.4;
}

.v2-mb-md {
  margin-bottom: 16px;
}

.v2-mb-lg {
  margin-bottom: 24px;
}

/* ========================================================================
   V2 INDUSTRIAL COMPATIBILITY BRIDGE
   Ensures any legacy view rendered inside V2 Layout is automatically
   styled with modern V2 design tokens, crisp borders, and typography
   instead of raw unstyled HTML.
   ======================================================================== */

/* Container & Cards */
.form-page-container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 24px;
}

.card {
  background: var(--mms-surface);
  border: 1px solid var(--mms-surface-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  margin-bottom: 24px;
  overflow: hidden;
}

.card-header {
  padding: 16px 20px;
  background: var(--mms-surface-subtle);
  border-bottom: 1px solid var(--mms-surface-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.card-body {
  padding: 20px;
}

.card-footer {
  padding: 14px 20px;
  background: var(--mms-surface-subtle);
  border-top: 1px solid var(--mms-surface-subtle);
}

.bg-light {
  background-color: var(--mms-surface-subtle) !important;
}

.border {
  border: 1px solid var(--mms-surface-subtle) !important;
}

.border-bottom {
  border-bottom: 1px solid var(--mms-surface-subtle) !important;
}

.border-top {
  border-top: 1px solid var(--mms-surface-subtle) !important;
}

.shadow-sm {
  box-shadow: var(--shadow-card) !important;
}

/* Typography & Headings */
.h1, .h2, .h3, .h4, .h5, .h6, h1, h2, h3, h4, h5, h6 {
  color: var(--mms-obsidian);
  font-weight: 700;
  letter-spacing: var(--mms-tracking-tight);
}

.small, small {
  font-size: 13px;
}

.fw-bold {
  font-weight: 700 !important;
}

.fw-semibold {
  font-weight: 600 !important;
}

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

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

.text-start {
  text-align: left !important;
}

/* Flexbox Utilities */
.d-flex {
  display: flex !important;
}

.d-inline-flex {
  display: inline-flex !important;
}

.d-none {
  display: none !important;
}

.d-block {
  display: block !important;
}

.flex-wrap {
  flex-wrap: wrap !important;
}

.flex-nowrap {
  flex-wrap: nowrap !important;
}

.flex-column {
  flex-direction: column !important;
}

.flex-row {
  flex-direction: row !important;
}

.justify-content-between {
  justify-content: space-between !important;
}

.justify-content-center {
  justify-content: center !important;
}

.justify-content-end {
  justify-content: flex-end !important;
}

.justify-content-start {
  justify-content: flex-start !important;
}

.align-items-center {
  align-items: center !important;
}

.align-items-start {
  align-items: flex-start !important;
}

.align-items-end {
  align-items: flex-end !important;
}

.align-self-center {
  align-self: center !important;
}

.flex-grow-1 {
  flex-grow: 1 !important;
}

.gap-1 { gap: 4px !important; }
.gap-1\.5 { gap: 6px !important; }
.gap-2 { gap: 8px !important; }
.gap-3 { gap: 16px !important; }
.gap-4 { gap: 24px !important; }

/* Grid System */
.row {
  display: flex;
  flex-wrap: wrap;
  margin-right: -8px;
  margin-left: -8px;
}

.row > * {
  box-sizing: border-box;
  padding-right: 8px;
  padding-left: 8px;
  max-width: 100%;
}

.g-1 { margin-right: -4px; margin-left: -4px; }
.g-1 > * { padding-right: 4px; padding-left: 4px; margin-bottom: 8px; }
.g-2 { margin-right: -6px; margin-left: -6px; }
.g-2 > * { padding-right: 6px; padding-left: 6px; margin-bottom: 12px; }
.g-3 { margin-right: -8px; margin-left: -8px; }
.g-3 > * { padding-right: 8px; padding-left: 8px; margin-bottom: 16px; }
.g-4 { margin-right: -12px; margin-left: -12px; }
.g-4 > * { padding-right: 12px; padding-left: 12px; margin-bottom: 24px; }

.col-12 { flex: 0 0 100%; width: 100%; }
.col-11 { flex: 0 0 91.666667%; width: 91.666667%; }
.col-10 { flex: 0 0 83.333333%; width: 83.333333%; }
.col-9  { flex: 0 0 75%; width: 75%; }
.col-8  { flex: 0 0 66.666667%; width: 66.666667%; }
.col-7  { flex: 0 0 58.333333%; width: 58.333333%; }
.col-6  { flex: 0 0 50%; width: 50%; }
.col-5  { flex: 0 0 41.666667%; width: 41.666667%; }
.col-4  { flex: 0 0 33.333333%; width: 33.333333%; }
.col-3  { flex: 0 0 25%; width: 25%; }
.col-2  { flex: 0 0 16.666667%; width: 16.666667%; }
.col-1  { flex: 0 0 8.333333%; width: 8.333333%; }

@media (min-width: 768px) {
  .col-md-12 { flex: 0 0 100%; width: 100%; }
  .col-md-10 { flex: 0 0 83.333333%; width: 83.333333%; }
  .col-md-9  { flex: 0 0 75%; width: 75%; }
  .col-md-8  { flex: 0 0 66.666667%; width: 66.666667%; }
  .col-md-6  { flex: 0 0 50%; width: 50%; }
  .col-md-5  { flex: 0 0 41.666667%; width: 41.666667%; }
  .col-md-4  { flex: 0 0 33.333333%; width: 33.333333%; }
  .col-md-3  { flex: 0 0 25%; width: 25%; }
  .col-md-2  { flex: 0 0 16.666667%; width: 16.666667%; }
}

@media (min-width: 992px) {
  .col-lg-12 { flex: 0 0 100%; width: 100%; }
  .col-lg-8  { flex: 0 0 66.666667%; width: 66.666667%; }
  .col-lg-6  { flex: 0 0 50%; width: 50%; }
  .col-lg-4  { flex: 0 0 33.333333%; width: 33.333333%; }
  .col-lg-3  { flex: 0 0 25%; width: 25%; }
}

/* Form Controls & Labels */
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--mms-obsidian);
  margin-bottom: 6px;
}

.form-control,
.form-select {
  display: block;
  width: 100%;
  min-height: 42px;
  padding: 8px 14px;
  font-size: 14px;
  font-family: inherit;
  color: var(--mms-obsidian);
  background-color: var(--mms-surface);
  border: 1px solid var(--mms-border-strong);
  border-radius: var(--radius-md);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  outline: none;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--mms-brand-primary);
  box-shadow: 0 0 0 3px rgba(0, 64, 152, 0.15);
}

.form-control-lg {
  min-height: 48px;
  padding: 10px 16px;
  font-size: 15px;
}

.form-check {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 24px;
}

.form-check-input {
  width: 18px;
  height: 18px;
  border: 1px solid var(--mms-border-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.form-check-label {
  font-size: 14px;
  color: var(--mms-obsidian);
  cursor: pointer;
}

.input-group {
  display: flex;
  width: 100%;
}

.input-group > .form-control {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  flex: 1;
}

.input-group > .btn {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--touch-target-min);
  padding: 0 18px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--mms-brand-primary);
  color: white !important;
  border-color: var(--mms-brand-primary);
}

.btn-primary:hover {
  background: var(--mms-brand-primary-hover);
  border-color: var(--mms-brand-primary-hover);
}

.btn-secondary {
  background: var(--mms-surface);
  color: var(--mms-obsidian) !important;
  border-color: var(--mms-border-strong);
}

.btn-secondary:hover {
  background: var(--mms-surface-subtle);
}

.btn-outline-secondary {
  background: transparent;
  color: var(--mms-obsidian-muted) !important;
  border-color: var(--mms-border-strong);
}

.btn-outline-secondary:hover {
  background: var(--mms-surface-subtle);
  color: var(--mms-obsidian) !important;
}

.btn-outline-primary {
  background: transparent;
  color: var(--mms-brand-primary) !important;
  border-color: var(--mms-brand-primary-border);
}

.btn-outline-primary:hover {
  background: var(--mms-brand-primary-soft);
  color: var(--mms-brand-primary-hover) !important;
}

.btn-danger {
  background: var(--mms-status-danger);
  color: white !important;
  border-color: var(--mms-status-danger);
}

.btn-sm {
  min-height: 34px;
  padding: 0 12px;
  font-size: 13px;
}

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--mms-obsidian-muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 16px;
  transition: color var(--transition-fast);
}

.btn-back:hover {
  color: var(--mms-brand-primary);
}

.w-100 {
  width: 100% !important;
}

/* Tables */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table {
  width: 100%;
  margin-bottom: 0;
  color: var(--mms-obsidian);
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 12px 16px;
  vertical-align: middle;
  border-top: 1px solid var(--mms-surface-subtle);
  font-size: 13px;
}

.table thead th {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--mms-obsidian-subtle);
  background-color: var(--mms-surface-subtle);
  border-bottom: 1px solid var(--mms-surface-subtle);
}

.table-striped tbody tr:nth-of-type(odd) {
  background-color: rgba(248, 250, 252, 0.6);
}

.table-hover tbody tr:hover {
  background-color: var(--mms-surface-hover);
}

/* Alerts */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  border: 1px solid transparent;
  margin-bottom: 16px;
}

.alert-danger {
  background: var(--mms-status-danger-bg);
  border-color: var(--mms-status-danger-border);
  color: var(--mms-status-danger-text);
}

.alert-warning {
  background: var(--mms-status-warning-bg);
  border-color: var(--mms-status-warning-border);
  color: var(--mms-status-warning-text);
}

.alert-info {
  background: var(--mms-status-info-bg);
  border-color: var(--mms-status-info-border);
  color: var(--mms-status-info-text);
}

.alert-success {
  background: var(--mms-status-success-bg);
  border-color: var(--mms-status-success-border);
  color: var(--mms-status-success-text);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 700;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.bg-primary {
  background-color: var(--mms-brand-primary-soft) !important;
  color: var(--mms-brand-primary) !important;
}

.bg-success {
  background-color: var(--mms-status-success-bg) !important;
  color: var(--mms-status-success-text) !important;
}

.bg-warning {
  background-color: var(--mms-status-warning-bg) !important;
  color: var(--mms-status-warning-text) !important;
}

.bg-danger {
  background-color: var(--mms-status-danger-bg) !important;
  color: var(--mms-status-danger-text) !important;
}

.bg-secondary {
  background-color: var(--mms-surface-subtle) !important;
  color: var(--mms-obsidian-muted) !important;
}

/* Spacings */
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 4px !important; }
.mb-2 { margin-bottom: 8px !important; }
.mb-3 { margin-bottom: 16px !important; }
.mb-4 { margin-bottom: 24px !important; }

.mt-1 { margin-top: 4px !important; }
.mt-2 { margin-top: 8px !important; }
.mt-3 { margin-top: 16px !important; }
.mt-4 { margin-top: 24px !important; }

.pb-1 { padding-bottom: 4px !important; }
.pb-2 { padding-bottom: 8px !important; }
.pb-3 { padding-bottom: 16px !important; }
.pb-4 { padding-bottom: 24px !important; }

.p-2 { padding: 8px !important; }
.p-3 { padding: 16px !important; }
.p-4 { padding: 24px !important; }

.px-2 { padding-left: 8px !important; padding-right: 8px !important; }
.px-3 { padding-left: 16px !important; padding-right: 16px !important; }
.px-4 { padding-left: 24px !important; padding-right: 24px !important; }

.py-2 { padding-top: 8px !important; padding-bottom: 8px !important; }
.py-3 { padding-top: 16px !important; padding-bottom: 16px !important; }
.py-4 { padding-top: 24px !important; padding-bottom: 24px !important; }

/* ========================================================================
   V2 LABEL LAYOUT & QR STICKER SHEET WORKSPACE
   Precision 6x5 physical sticker grid (16.5cm x 21cm, 30 slots A1-E6)
   ======================================================================== */

.label-layout-page,
.v2-label-layout-page {
  max-width: 1080px;
  margin: 0 auto;
  padding-bottom: 4rem;
}

.label-layout-header,
.v2-label-layout-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.label-layout-count,
.v2-label-layout-count {
  min-width: 130px;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-line, #E2E8F0);
  background: var(--mms-brand-primary-soft);
  box-shadow: var(--shadow-xs);
}

.label-layout-count strong {
  display: block;
  font-family: var(--mms-font-tabular);
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--mms-brand-primary);
  line-height: 1;
}

.label-layout-count span {
  display: block;
  margin-top: 4px;
  color: var(--mms-obsidian-muted);
  font-size: 12px;
  font-weight: 600;
}

.label-mode-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin: 0 0 1.5rem;
  padding: 0;
  border: 0;
  width: 100%;
}

@media (max-width: 640px) {
  .label-mode-picker {
    grid-template-columns: 1fr;
  }
}

.label-mode-picker legend {
  grid-column: 1 / -1;
  width: 100%;
  font-size: 14px;
  font-weight: 700;
  color: var(--mms-obsidian);
  margin-bottom: 8px;
}

.label-mode-option {
  position: relative;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  width: 100%;
  min-width: 0;
  height: 100%;
}

.label-mode-option input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}

.label-mode-option span {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  height: 100%;
  box-sizing: border-box;
  padding: 16px 20px;
  border: 1.5px solid var(--mms-border);
  border-radius: var(--radius-lg);
  background: var(--mms-surface);
  transition: all var(--transition-fast);
}

.label-mode-option span strong {
  font-size: 15px;
  font-weight: 700;
  color: var(--mms-obsidian);
}

.label-mode-option span small {
  margin-top: 4px;
  color: var(--mms-obsidian-muted);
  font-size: 13px;
}

.label-mode-option input:checked + span {
  border-color: var(--mms-brand-primary);
  background: var(--mms-brand-primary-soft);
  box-shadow: 0 0 0 1px var(--mms-brand-primary);
}

.label-sheet-workspace {
  padding: 24px;
  border: 1px solid var(--mms-border);
  border-radius: var(--radius-lg);
  background: var(--mms-surface);
  box-shadow: var(--shadow-card);
  margin-bottom: 24px;
}

.label-sheet-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--mms-surface-subtle);
}

.label-sheet-kicker {
  font-size: 11px;
  font-weight: 800;
  color: var(--mms-brand-primary);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.label-sheet-toolbar h2 {
  font-size: 18px;
  font-weight: 800;
  color: var(--mms-obsidian);
  margin: 2px 0 0;
}

.label-sheet-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.label-sheet-tabs {
  display: flex;
  gap: 8px;
  margin: 16px 0;
  overflow-x: auto;
  padding-bottom: 4px;
}

.label-sheet-tab {
  min-height: 40px;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--mms-border);
  background: var(--mms-surface);
  color: var(--mms-obsidian-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.label-sheet-tab.active {
  background: var(--mms-brand-primary);
  border-color: var(--mms-brand-primary);
  color: #FFFFFF;
}

.label-sheet-stage {
  max-width: 680px;
  margin: 20px auto;
  padding: 20px;
  border-radius: var(--radius-lg);
  background: #F1F5F9;
  border: 1px solid #E2E8F0;
}

.label-sheet-preview {
  display: grid;
  grid-template-columns: 28px repeat(6, minmax(0, 1fr));
  grid-template-rows: 24px repeat(5, minmax(0, 1fr));
  gap: 8px;
  padding: 16px;
  aspect-ratio: 16.5 / 21;
  background: #FFFFFF;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
  border: 1px solid #E2E8F0;
}

.label-sheet-column,
.label-sheet-row,
.label-sheet-corner {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748B;
  font-family: var(--mms-font-tabular);
  font-size: 13px;
  font-weight: 700;
}

.label-slot {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  overflow: hidden;
  cursor: pointer;
  border-radius: 6px;
  border: 1.5px dashed #CBD5E1;
  background: #F8FAFC;
  padding: 4px;
  transition: all var(--transition-fast);
  user-select: none;
}

.label-slot input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}

.label-slot__code {
  font-family: var(--mms-font-tabular);
  font-size: 12px;
  font-weight: 800;
  color: #64748B;
  line-height: 1;
}

.label-slot__assignment {
  font-size: 10px;
  font-weight: 700;
  color: #94A3B8;
  margin-top: 3px;
  line-height: 1;
}

.label-slot:hover {
  border-color: #94A3B8;
  background: #F1F5F9;
}

.label-slot--assigned {
  border: 1.5px solid var(--mms-brand-primary);
  background: var(--mms-brand-primary-soft);
}

.label-slot--assigned .label-slot__code {
  color: var(--mms-brand-primary);
}

.label-slot--assigned .label-slot__assignment {
  color: var(--mms-brand-primary);
  background: #DBEAFE;
  padding: 2px 4px;
  border-radius: 3px;
}

.label-slot--reserved {
  border: 1.5px solid #FCD34D;
  background: #FFFBEB;
}

.label-slot--reserved .label-slot__code {
  color: #B45309;
}

.label-slot--reserved .label-slot__assignment {
  color: #B45309;
}

.label-start-control {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: #F8FAFC;
  border-radius: var(--radius-md);
  border: 1px solid var(--mms-border);
  margin-top: 16px;
  flex-wrap: wrap;
}

.label-start-control label {
  font-size: 13px;
  font-weight: 600;
  color: var(--mms-obsidian);
}

.label-export-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  background: var(--mms-surface);
  border: 1px solid var(--mms-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  flex-wrap: wrap;
}

.label-export-bar strong {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: var(--mms-obsidian);
}

.label-export-bar small {
  color: var(--mms-obsidian-subtle);
  font-size: 12px;
}

/* ========================================================================
   ENTERPRISE DATA TABLE: Collapsible Rows, Model Pills, Popovers & Ergonomics
   ======================================================================== */

.v2-table tbody tr.v2-table-parent-row {
  cursor: pointer;
  transition: background var(--transition-fast, 0.15s ease);
}

.v2-table tbody tr.v2-table-parent-row:hover {
  background: #F0F7FF !important;
}

.v2-table tbody tr.v2-table-parent-row.is-expanded {
  background: #EFF6FF !important;
  border-bottom-color: transparent;
}

.v2-table tbody tr.v2-table-subrow {
  background: #F8FAFC !important;
  border-bottom: 2px solid #CBD5E1;
}

.v2-table tbody tr.v2-table-subrow td {
  padding: 0 !important;
}

.v2-table-subrow-content {
  padding: 16px 20px;
  animation: v2FadeDown 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes v2FadeDown {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Compatible Model Pill Badges */
.v2-model-pill-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  max-width: 100%;
}

.v2-model-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 4px;
  background: #F1F5F9;
  color: #334155;
  font-size: 11px;
  font-weight: 600;
  font-family: var(--mms-font-mono, monospace);
  border: 1px solid #CBD5E1;
  white-space: nowrap;
  letter-spacing: -0.01em;
}

.v2-model-pill-more {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--color-brand-soft, #ebf3fb);
  color: var(--color-brand, #0057b8);
  font-size: 11px;
  font-weight: 700;
  border: 1px solid var(--color-brand-border, #b8d4f2);
  cursor: pointer;
  position: relative;
  transition: background-color 0.15s ease, border-color 0.15s ease;
  user-select: none;
}

.v2-model-pill-more:hover {
  background: #DBEAFE;
  border-color: #93C5FD;
}

.v2-model-popover {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #0F172A;
  color: #F8FAFC;
  padding: 10px 14px;
  border-radius: 8px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.25);
  z-index: 100;
  min-width: 220px;
  max-width: 320px;
  font-size: 11.5px;
  font-weight: 400;
  line-height: 1.4;
  text-align: left;
  pointer-events: none;
}

.v2-model-pill-more:hover .v2-model-popover,
.v2-model-pill-more:focus .v2-model-popover,
.v2-model-pill-more.is-active .v2-model-popover {
  display: block;
}

.v2-model-popover::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: #0F172A transparent transparent transparent;
}

/* Copy-to-Clipboard Icon Button */
.v2-copy-wrapper {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.v2-copy-btn {
  opacity: 0;
  padding: 2px 4px;
  background: transparent;
  border: none;
  border-radius: 4px;
  color: #94A3B8;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.v2-copy-wrapper:hover .v2-copy-btn,
.v2-copy-btn:focus {
  opacity: 1;
}

.v2-copy-btn:hover {
  color: var(--color-brand, #0057b8);
  background: #E2E8F0;
}

/* Keyboard Shortcut Badge (KBD) */
.v2-kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  font-size: 11px;
  font-family: var(--mms-font-mono, monospace);
  font-weight: 600;
  line-height: 1;
  color: #64748B;
  background: #F1F5F9;
  border: 1px solid #CBD5E1;
  border-radius: 4px;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
}

/* Table Row Expand Chevron */
.v2-expand-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  color: #64748B;
  transition: transform 0.2s ease, background 0.15s ease, color 0.15s ease;
}

.v2-expand-chevron:hover {
  background: #E2E8F0;
  color: #0F172A;
}

.is-expanded .v2-expand-chevron {
  transform: rotate(90deg);
  color: var(--color-brand, #0057b8);
}

/* Mobile & Tablet Card Layout Fallback */
@media (max-width: 768px) {
  .v2-table-responsive-cards thead {
    display: none;
  }
  .v2-table-responsive-cards tbody tr.v2-table-parent-row {
    display: flex;
    flex-direction: column;
    padding: 14px 16px;
    border-bottom: 1px solid #E2E8F0;
    gap: 8px;
  }
  .v2-table-responsive-cards tbody tr.v2-table-parent-row td {
    padding: 2px 0 !important;
    border-bottom: none;
  }
  .v2-table-responsive-cards tbody tr.v2-table-subrow-content {
    padding: 12px 14px;
  }
}


