/* ==========================================================================
   MACC Salesforce Migration Tool - Design System & Modern UI
   ========================================================================== */

:root {
  /* ==========================================================================
     MACC Brand Palette (Logo Colors)
     ========================================================================== */
  --brand-primary: #1797C0;
  --brand-primary-hover: #1383a7;
  --brand-primary-light: #2ab5e2;
  --brand-primary-complement: #FFFFFF;
  --brand-secondary: #51606E;
  --brand-secondary-hover: #3f4c58;
  --brand-secondary-complement: #FFFFFF;
  --brand-tertiary: #DDE4E9;
  --brand-tertiary-complement: #222222;
  --brand-quaternary: #B1BAC1;
  --brand-quaternary-complement: #222222;
  --brand-zeronary: #51606E;
  --brand-zeronary-complement: #FFFFFF;

  /* Logo Gold Accent (Letter 'A' & 'TECH AND DIGITAL' in logo) */
  --brand-gold: #DEB76C;
  --brand-gold-hover: #cfa85e;
  --brand-gold-light: #ebd096;
  --brand-gold-glow: rgba(222, 183, 108, 0.28);
  --brand-gold-bg: rgba(222, 183, 108, 0.12);
  --brand-gold-border: rgba(222, 183, 108, 0.35);

  /* Color Palette - Dark Mode (Default) */
  --bg-main: #0c1017;
  --bg-surface: #131922;
  --bg-card: #18222e;
  --bg-card-hover: #202b3a;
  --bg-card-active: #273446;
  --bg-input: #10151e;

  --border-subtle: rgba(81, 96, 110, 0.32);
  --border-strong: rgba(177, 186, 193, 0.28);
  --border-focus: #1797C0;

  --text-main: #f8fafc;
  --text-muted: #B1BAC1;
  --text-subtle: #798997;

  /* Accent & Status Colors */
  --accent-primary: #1797C0;
  --accent-primary-hover: #1383a7;
  --accent-glow: rgba(23, 151, 192, 0.28);
  
  --sf-blue: #1797C0;
  --sf-dark-blue: #0f4c63;

  --status-success: #10b981;
  --status-success-bg: rgba(16, 185, 129, 0.12);
  --status-success-border: rgba(16, 185, 129, 0.3);

  --status-warning: #DEB76C;
  --status-warning-bg: rgba(222, 183, 108, 0.12);
  --status-warning-border: rgba(222, 183, 108, 0.35);

  --status-danger: #ef4444;
  --status-danger-bg: rgba(239, 68, 68, 0.12);
  --status-danger-border: rgba(239, 68, 68, 0.3);

  --status-info: #1797C0;
  --status-info-bg: rgba(23, 151, 192, 0.12);

  /* Elevation & Shadows */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 6px 18px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 14px 34px rgba(0, 0, 0, 0.55);
  --shadow-modal: 0 25px 50px -12px rgba(0, 0, 0, 0.7);

  /* Radii */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Typography */
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', Consolas, Monaco, monospace;

  /* Transitions */
  --trans-fast: 0.15s ease;
  --trans-normal: 0.25s ease;
}

/* Light Theme Overrides */
html[data-theme="light"] {
  --bg-main: #f5f8fa;
  --bg-surface: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f0f4f7;
  --bg-card-active: #DDE4E9;
  --bg-input: #ffffff;

  --border-subtle: #DDE4E9;
  --border-strong: #B1BAC1;
  --border-focus: #1797C0;

  --text-main: #222222;
  --text-muted: #51606E;
  --text-subtle: #6e7f8e;

  --brand-gold: #b88f40;
  --brand-gold-glow: rgba(184, 143, 64, 0.22);
  --brand-gold-bg: rgba(184, 143, 64, 0.12);
  --brand-gold-border: rgba(184, 143, 64, 0.35);

  --status-warning: #b88f40;
  --status-warning-bg: rgba(184, 143, 64, 0.12);
  --status-warning-border: rgba(184, 143, 64, 0.35);

  --accent-primary: #1797C0;
  --accent-primary-hover: #1383a7;
  --accent-glow: rgba(23, 151, 192, 0.22);

  --shadow-sm: 0 1px 3px rgba(34, 34, 34, 0.06);
  --shadow-md: 0 4px 12px rgba(81, 96, 110, 0.08);
  --shadow-lg: 0 12px 28px rgba(81, 96, 110, 0.12);
  --shadow-modal: 0 20px 45px rgba(34, 34, 34, 0.16);
}

/* Base Reset & Typography */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: var(--font-sans);
  line-height: 1.5;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Utilities */
.hidden { display: none !important; }
.text-success { color: var(--status-success) !important; }
.text-danger { color: var(--status-danger) !important; }
.text-warning { color: var(--status-warning) !important; }

/* ==========================================================================
   Header / Navbar
   ========================================================================== */
.navbar {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-sm);
}

.nav-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.brand-logo-container {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  padding: 5px 12px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
  transition: all var(--trans-fast);
}

.brand-logo-container:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.brand-logo-img {
  height: 30px;
  width: auto;
  display: block;
  object-fit: contain;
}

.brand-divider {
  width: 2px;
  height: 28px;
  background: linear-gradient(180deg, var(--brand-gold) 0%, rgba(222, 183, 108, 0.2) 100%);
  margin: 0 0.35rem;
  border-radius: 1px;
}

.brand-title {
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

.brand-subtitle {
  font-size: 0.78rem;
  color: var(--brand-gold);
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* Header Navigation Tabs */
.nav-menu {
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 3px;
  gap: 3px;
}

.nav-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 1rem;
  border-radius: var(--radius-full);
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  transition: all var(--trans-fast);
}

.nav-tab svg {
  flex-shrink: 0;
  transition: transform var(--trans-fast);
}

.nav-tab:hover {
  color: var(--text-main);
  background: var(--bg-card-hover);
}

.nav-tab.active {
  background: var(--accent-primary);
  color: #ffffff;
  box-shadow: 0 2px 10px var(--accent-glow);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.35rem 0.8rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
  transition: all var(--trans-fast);
}

.pill-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.status-disconnected {
  background: rgba(148, 163, 184, 0.1);
  color: var(--text-subtle);
}
.status-disconnected .pill-dot { background: var(--text-subtle); }

.status-connected {
  background: var(--status-success-bg);
  border-color: var(--status-success-border);
  color: var(--status-success);
}
.status-connected .pill-dot {
  background: var(--status-success);
  box-shadow: 0 0 8px var(--status-success);
}

.status-error {
  background: var(--status-danger-bg);
  border-color: var(--status-danger-border);
  color: var(--status-danger);
}
.status-error .pill-dot { background: var(--status-danger); }

.btn-icon {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--trans-fast);
}

.btn-icon:hover {
  background: var(--bg-card-hover);
  color: var(--text-main);
  border-color: var(--border-strong);
}

/* ==========================================================================
   Stepper Navigation
   ========================================================================== */
.stepper-bar {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.75rem 1.5rem;
}

.stepper-container {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.step-nav-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  opacity: 0.55;
  transition: all var(--trans-normal);
}

.step-nav-item.active {
  opacity: 1;
}

.step-nav-item.completed {
  opacity: 0.9;
}

.step-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--border-strong);
  color: var(--text-main);
  font-size: 0.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.step-nav-item.active .step-num {
  background: var(--accent-primary);
  color: #ffffff;
  box-shadow: 0 0 10px var(--accent-glow);
}

.step-nav-item.completed .step-num {
  background: var(--status-success);
  color: #ffffff;
}

.step-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
}

.step-divider {
  flex: 1;
  height: 2px;
  background: var(--border-subtle);
  margin: 0 1.25rem;
}

/* ==========================================================================
   Main Content Layout
   ========================================================================== */
.app-main {
  max-width: 1100px;
  width: 100%;
  margin: 1.75rem auto 3rem;
  padding: 0 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.panel-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  transition: border-color var(--trans-normal);
}

.panel-card:hover {
  border-color: var(--border-strong);
}

.panel-header {
  padding: 1.25rem 1.75rem;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.panel-header-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.panel-badge {
  background: var(--brand-gold-bg);
  color: var(--brand-gold);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--brand-gold-border);
}

.panel-header h2 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.panel-header .help-text {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.panel-body {
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* ==========================================================================
   Buttons & Inputs
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--trans-fast);
  white-space: nowrap;
  text-decoration: none;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed !important;
  box-shadow: none !important;
}

.btn-primary {
  background: var(--accent-primary);
  color: #ffffff;
  border-color: var(--accent-primary);
  box-shadow: 0 2px 8px var(--accent-glow);
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-primary-hover);
  box-shadow: 0 4px 14px var(--accent-glow);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-main);
  border-color: var(--border-strong);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--bg-card-hover);
  border-color: var(--brand-gold);
  color: var(--brand-gold);
}

.btn-success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
}

.btn-success:hover:not(:disabled) {
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.45);
  transform: translateY(-1px);
}

.btn-danger {
  background: var(--status-danger);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover:not(:disabled) {
  background: #dc2626;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.45);
}

.btn-danger-ghost {
  background: transparent;
  color: var(--status-danger);
  border: 1px solid var(--status-danger-border);
  padding: 0.65rem;
  border-radius: var(--radius-md);
}

.btn-danger-ghost:hover:not(:disabled) {
  background: var(--status-danger-bg);
  border-color: var(--status-danger);
}

.btn-lg {
  padding: 0.8rem 1.6rem;
  font-size: 1rem;
  border-radius: var(--radius-lg);
}

.link-btn {
  background: none;
  border: none;
  color: var(--border-focus);
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
  font-size: inherit;
}

/* Spinner */
.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Forms & Selects */
.select-wrapper {
  flex: 1;
  position: relative;
}

select, input:not([type="radio"]):not([type="checkbox"]) {
  width: 100%;
  background: var(--bg-input);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.95rem;
  font-family: var(--font-sans);
  font-size: 0.92rem;
  transition: all var(--trans-fast);
}

select:focus, input:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* ==========================================================================
   Step 1: Org Management Styles
   ========================================================================== */
.org-selector-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
}

select:disabled {
  opacity: 0.88;
  cursor: not-allowed;
  background: var(--bg-surface-sunken, rgba(0, 0, 0, 0.15));
  color: var(--text-main);
  border-color: var(--border-subtle);
}

.org-readonly-banner {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.85rem;
  background: rgba(30, 167, 110, 0.08);
  border: 1px solid rgba(30, 167, 110, 0.25);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 0.82rem;
  margin-bottom: 0.75rem;
}

.org-readonly-banner strong {
  color: var(--success);
}

.org-preview-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.preview-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.preview-label {
  font-size: 0.75rem;
  color: var(--text-subtle);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.preview-mono {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-main);
  word-break: break-all;
}

/* Environment Badges */
.env-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-full);
  width: fit-content;
}

.env-sandbox {
  background: rgba(23, 151, 192, 0.15);
  color: var(--brand-primary-light);
  border: 1px solid rgba(23, 151, 192, 0.35);
}

.env-production {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.35);
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.2);
}

.env-dev {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.env-scratch {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

/* Status / Callout Box */
.callout {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 1.15rem;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  border: 1px solid transparent;
  animation: fadeIn 0.2s ease;
}

.callout-success {
  background: var(--status-success-bg);
  border-color: var(--status-success-border);
  color: var(--status-success);
}

.callout-danger {
  background: var(--status-danger-bg);
  border-color: var(--status-danger-border);
  color: #fca5a5;
}

.callout-info {
  background: var(--status-info-bg);
  border-color: rgba(99, 102, 241, 0.3);
  color: #a5b4fc;
}

/* ==========================================================================
   Step 2: Files & Mode
   ========================================================================== */
.mode-select-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.mode-card {
  position: relative;
  background: var(--bg-surface);
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  transition: all var(--trans-fast);
}

.mode-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-strong);
}

.mode-card input[type="radio"] {
  width: auto;
  margin-top: 0.2rem;
  cursor: pointer;
  accent-color: var(--accent-primary);
}

.mode-card.active {
  border-color: var(--border-focus);
  background: rgba(23, 151, 192, 0.05);
  box-shadow: 0 0 15px var(--accent-glow);
}

/* Disabled / Work In Progress Mode Card */
.mode-card.mode-card-disabled {
  cursor: not-allowed;
  user-select: none;
  border-style: dashed;
  position: relative;
  overflow: hidden;
}

.mode-card.mode-card-disabled:hover {
  background: var(--bg-surface);
  border-color: var(--border-subtle);
  box-shadow: none;
  transform: none;
}

.mode-card.mode-card-disabled input[type="radio"] {
  cursor: not-allowed;
  opacity: 0.4;
  pointer-events: none;
}

.mode-card.mode-card-disabled .mode-card-content {
  opacity: 0.88;
}

.mode-wip-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.16);
  backdrop-filter: blur(1px);
  -webkit-backdrop-filter: blur(1px);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-lg);
  pointer-events: none;
  z-index: 2;
  transition: all var(--trans-fast);
}

[data-theme="light"] .mode-wip-overlay {
  background: rgba(248, 250, 252, 0.24);
}

.mode-wip-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(15, 23, 42, 0.72);
  color: var(--text-main);
  border: 1px solid var(--border-strong);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
  padding: 0.35rem 0.8rem;
  border-radius: var(--radius-full);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

[data-theme="light"] .mode-wip-badge {
  background: rgba(255, 255, 255, 0.92);
  color: var(--text-main);
  border-color: rgba(0, 0, 0, 0.14);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.mode-wip-badge svg {
  flex-shrink: 0;
  color: #f97316;
}

.mode-card-content {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.mode-title-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.mode-title {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-main);
}

.mode-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.badge-mini {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
}

.badge-green { background: var(--status-success-bg); color: var(--status-success); }
.badge-blue { background: rgba(23, 151, 192, 0.15); color: var(--brand-primary-light); }
.badge-gold { background: var(--brand-gold-bg); color: var(--brand-gold); border: 1px solid var(--brand-gold-border); }

/* Drop Zone */
.drop-zone {
  border: 2px dashed var(--border-strong);
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  padding: 2.25rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--trans-normal);
  position: relative;
}

.drop-zone:hover, .drop-zone.dragover {
  border-color: var(--border-focus);
  background: rgba(23, 151, 192, 0.05);
  box-shadow: 0 0 20px var(--accent-glow);
}

.file-input-hidden {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 5;
}

.drop-zone-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  pointer-events: none;
}

.drop-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(23, 151, 192, 0.12);
  color: var(--accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.drop-main-text {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
}

.drop-sub-text {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Files Checklist */
.files-checklist-container {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

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

.checklist-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-pill {
  font-size: 0.78rem;
  font-weight: 700;
  background: var(--bg-surface);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-full);
}

.badge-pill.complete {
  background: var(--status-success-bg);
  border-color: var(--status-success-border);
  color: var(--status-success);
}

.files-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 0.85rem;
}

.file-item-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  transition: all var(--trans-fast);
}

.file-item-card.ready {
  border-color: var(--status-success-border);
  background: rgba(16, 185, 129, 0.04);
}

.file-item-card.missing {
  opacity: 0.75;
}

.file-item-info {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  overflow: hidden;
}

.file-item-icon {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.file-item-card.ready .file-item-icon {
  background: var(--status-success-bg);
  color: var(--status-success);
}

.file-item-card.missing .file-item-icon {
  background: rgba(148, 163, 184, 0.1);
  color: var(--text-subtle);
}

.file-item-name {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-item-size {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.upload-action-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

/* ==========================================================================
   Step 3: Execution & Monitoring
   ========================================================================== */
.run-timer-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  padding: 0.45rem 0.95rem;
  border-radius: var(--radius-full);
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--brand-gold);
}

.timer-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--status-danger);
  animation: pulseDot 1s infinite alternate;
}

@keyframes pulseDot {
  from { opacity: 0.3; }
  to { opacity: 1; box-shadow: 0 0 8px var(--status-danger); }
}

.run-dashboard-bar {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  display: grid;
  grid-template-columns: 1.2fr 2fr 1fr 1fr 1fr;
  gap: 1.5rem;
  align-items: center;
}

@media (max-width: 1100px) {
  .run-dashboard-bar {
    grid-template-columns: 1fr 1fr;
  }
}

.dashboard-metric {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.metric-label {
  font-size: 0.75rem;
  color: var(--text-subtle);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.status-badge {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  width: fit-content;
}

.badge-idle { background: rgba(148, 163, 184, 0.15); color: var(--text-muted); }
.badge-running {
  background: rgba(23, 151, 192, 0.15);
  color: var(--brand-primary-light);
  border: 1px solid rgba(23, 151, 192, 0.35);
  animation: pulseRunning 2s infinite;
}
.badge-completed {
  background: var(--status-success-bg);
  color: var(--status-success);
  border: 1px solid var(--status-success-border);
}
.badge-failed {
  background: var(--status-danger-bg);
  color: var(--status-danger);
  border: 1px solid var(--status-danger-border);
}

@keyframes pulseRunning {
  0% { box-shadow: 0 0 0 0 rgba(23, 151, 192, 0.45); }
  70% { box-shadow: 0 0 0 10px rgba(23, 151, 192, 0); }
  100% { box-shadow: 0 0 0 0 rgba(23, 151, 192, 0); }
}

.progress-container {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.progress-bar-bg {
  flex: 1;
  height: 8px;
  background: var(--border-subtle);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #1797C0 0%, #10b981 100%);
  border-radius: var(--radius-full);
  transition: width 0.4s ease;
}

.metric-percent {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
}

.metric-stat {
  border-left: 1px solid var(--border-subtle);
  padding-left: 1rem;
}

.stat-count {
  font-family: var(--font-mono);
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.1;
}

/* Pipeline Steps List */
.pipeline-list-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.pipeline-list-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.pipeline-steps-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.pipeline-step-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.75rem 1.15rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  transition: all var(--trans-fast);
}

.step-info-group {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.step-status-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.step-name-box {
  display: flex;
  flex-direction: column;
}

.step-primary-name {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text-main);
}

.step-sub-name {
  font-size: 0.75rem;
  color: var(--text-subtle);
  font-family: var(--font-mono);
}

/* Step States */
.pipeline-step-item.pending {
  opacity: 0.6;
}
.pipeline-step-item.pending .step-status-icon {
  background: var(--bg-card);
  color: var(--text-subtle);
  border: 1px solid var(--border-subtle);
}

.pipeline-step-item.running {
  opacity: 1;
  border-color: var(--border-focus);
  background: rgba(23, 151, 192, 0.06);
  box-shadow: 0 0 14px var(--accent-glow);
}
.pipeline-step-item.running .step-status-icon {
  background: var(--accent-primary);
  color: #ffffff;
}

.pipeline-step-item.completed {
  opacity: 1;
  border-color: var(--status-success-border);
  background: rgba(16, 185, 129, 0.02);
}
.pipeline-step-item.completed .step-status-icon {
  background: var(--status-success-bg);
  color: var(--status-success);
}

.pipeline-step-item.failed {
  opacity: 1;
  border-color: var(--status-danger-border);
  background: var(--status-danger-bg);
}
.pipeline-step-item.failed .step-status-icon {
  background: var(--status-danger);
  color: #ffffff;
}

.step-metrics-group {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.pill-count {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
}

.pill-count-ok {
  background: var(--status-success-bg);
  color: var(--status-success);
  border: 1px solid var(--status-success-border);
}

.pill-count-ko {
  background: var(--status-danger-bg);
  color: var(--status-danger);
  border: 1px solid var(--status-danger-border);
}

.pill-count-warn {
  background: var(--status-warning-bg);
  color: var(--status-warning);
  border: 1px solid var(--status-warning-border);
}

.step-error-msg {
  font-size: 0.78rem;
  color: #f87171;
  background: rgba(239, 68, 68, 0.15);
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ==========================================================================
   Modals
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  animation: fadeIn 0.15s ease;
}

.modal-container {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-modal);
  width: 100%;
  max-width: 580px;
  overflow: hidden;
  animation: slideUp 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-sm { max-width: 440px; }
.modal-lg { max-width: 720px; }

.modal-danger-border {
  border-color: rgba(239, 68, 68, 0.6);
  box-shadow: 0 0 35px rgba(239, 68, 68, 0.25);
}

.modal-header {
  padding: 1.25rem 1.5rem;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.modal-icon-badge {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: rgba(23, 151, 192, 0.15);
  color: var(--accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-icon-badge.badge-danger {
  background: var(--status-danger-bg);
  color: var(--status-danger);
}

.modal-icon-badge.badge-warning-pulsing {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
  animation: pulseDot 1s infinite alternate;
}

.modal-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
}

.btn-modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
  padding: 0.25rem;
}

.btn-modal-close:hover {
  color: var(--text-main);
}

.modal-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  max-height: 80vh;
  overflow-y: auto;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
}

.form-group .required {
  color: var(--status-danger);
}

.field-hint {
  font-size: 0.76rem;
  color: var(--text-subtle);
}

.role-checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.role-checkbox-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm, 6px);
  background: var(--bg-input);
  font-size: 0.82rem;
  cursor: pointer;
}

.role-checkbox-chip input {
  margin: 0;
}

.secret-box {
  background: var(--bg-input);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

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

.secret-box-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--status-warning);
  text-transform: uppercase;
}

.btn-copy-small {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  color: var(--text-main);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.btn-copy-small:hover {
  background: var(--accent-primary);
  color: #ffffff;
}

.secret-box code {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--brand-primary);
  word-break: break-all;
  background: rgba(0, 0, 0, 0.25);
  padding: 0.5rem;
  border-radius: var(--radius-sm);
}

.secret-box-desc {
  font-size: 0.76rem;
  color: var(--text-muted);
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

/* Production Safeguard Styling */
.warning-callout {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: var(--radius-md);
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.warning-msg-text {
  font-size: 0.95rem;
  color: #f87171;
}

.warning-sub {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.confirm-prompt-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.confirm-prompt-group code {
  font-family: var(--font-mono);
  color: #f87171;
  font-weight: 700;
}

/* Help Modal Body */
.help-body h4 {
  font-size: 0.95rem;
  color: var(--border-focus);
  margin-top: 0.5rem;
}

.help-body p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.help-files-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.help-files-list li {
  font-size: 0.82rem;
  color: var(--text-muted);
  padding-left: 0.75rem;
  border-left: 2px solid var(--border-focus);
}

.help-files-list code {
  font-family: var(--font-mono);
  color: var(--text-main);
  font-weight: 600;
}

/* ==========================================================================
   Toast Notifications
   ========================================================================== */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 0.85rem 1.25rem;
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 260px;
  max-width: 420px;
  animation: toastIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  transition: all var(--trans-normal);
}

.toast.toast-success {
  border-color: var(--status-success-border);
  color: var(--text-main);
}
.toast.toast-success::before {
  content: "✓";
  color: var(--status-success);
  font-weight: 800;
}

.toast.toast-error {
  border-color: var(--status-danger-border);
  color: var(--text-main);
}
.toast.toast-error::before {
  content: "✕";
  color: var(--status-danger);
  font-weight: 800;
}

.toast.toast-info {
  border-color: rgba(23, 151, 192, 0.4);
  color: var(--text-main);
}
.toast.toast-info::before {
  content: "ℹ";
  color: var(--brand-primary);
  font-weight: 800;
}

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

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

/* ==========================================================================
   Dashboard & Analytics Styling
   ========================================================================== */
.dashboard-main {
  max-width: 1180px;
  gap: 2rem;
}

.dashboard-header-banner {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.dash-title-group {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.dash-badge-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.dash-title-group h1 {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--text-main);
  line-height: 1.15;
}

.dash-subtitle {
  font-size: 0.88rem;
  color: var(--text-muted);
  max-width: 680px;
  line-height: 1.45;
}

.dash-header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* KPI Cards Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1.15rem;
}

@media (max-width: 1100px) {
  .kpi-grid {
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  }
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.35rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
  transition: all var(--trans-normal);
}

.kpi-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}

.kpi-icon-wrapper {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.kpi-icon-blue {
  background: rgba(23, 151, 192, 0.15);
  color: var(--accent-primary);
  border: 1px solid rgba(23, 151, 192, 0.3);
}

.kpi-icon-gold {
  background: var(--brand-gold-bg);
  color: var(--brand-gold);
  border: 1px solid var(--brand-gold-border);
}

.kpi-icon-green {
  background: var(--status-success-bg);
  color: var(--status-success);
  border: 1px solid var(--status-success-border);
}

.kpi-icon-red {
  background: var(--status-danger-bg);
  color: var(--status-danger);
  border: 1px solid var(--status-danger-border);
}

.kpi-icon-warning {
  background: var(--status-warning-bg);
  color: var(--status-warning);
  border: 1px solid var(--status-warning-border);
}

.kpi-data {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  flex: 1;
}

.kpi-label {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-subtle);
}

.kpi-value-row {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.kpi-value {
  font-size: 1.85rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--text-main);
  line-height: 1.1;
}

.kpi-gold { color: var(--brand-gold) !important; }
.kpi-green { color: var(--status-success) !important; }
.kpi-red { color: var(--status-danger) !important; }
.kpi-warning { color: var(--status-warning) !important; }

.kpi-subtext {
  font-size: 0.76rem;
  color: var(--text-muted);
}

.kpi-mini-progress {
  height: 5px;
  background: var(--border-subtle);
  border-radius: var(--radius-full);
  margin-top: 0.35rem;
  overflow: hidden;
}

.kpi-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--brand-gold) 0%, #10b981 100%);
  border-radius: var(--radius-full);
  transition: width 0.6s ease;
}

/* Charts Section */
.charts-section {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: border-color var(--trans-normal);
}

.chart-card:hover {
  border-color: var(--border-strong);
}

.chart-header {
  padding: 1.15rem 1.6rem 0.95rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.85rem;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-surface);
}

.chart-title-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.chart-title-row h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
}

.chart-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

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

.legend-pill {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

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

.dot-ok { background: #10b981; }
.dot-ko { background: #ef4444; }
.dot-rate { background: var(--brand-gold); }

.chart-body {
  padding: 1.35rem 1.6rem 1.5rem;
}

.charts-duo-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 1.5rem;
}

/* History Section & Collapsible Accordion */
.history-section {
  margin-top: 0.5rem;
}

.history-panel-header {
  align-items: flex-start;
  gap: 1.25rem;
}

.history-controls {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.search-input-box {
  position: relative;
  min-width: 220px;
}

.search-input-box svg {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-subtle);
  pointer-events: none;
}

.search-input-box input {
  padding-left: 2.25rem !important;
  font-size: 0.85rem;
}

.filter-select-box select {
  min-width: 150px;
  font-size: 0.85rem;
}

.history-toggle-buttons {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-sm {
  padding: 0.45rem 0.8rem;
  font-size: 0.8rem;
}

.history-panel-body {
  padding: 1.25rem;
}

.runs-accordion {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.accordion-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all var(--trans-normal);
}

.accordion-item:hover {
  border-color: var(--border-strong);
}

.accordion-item.expanded {
  border-color: var(--border-focus);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.25);
}

.accordion-header {
  padding: 1rem 1.35rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  cursor: pointer;
  user-select: none;
  background: var(--bg-surface);
  transition: background var(--trans-fast);
}

.accordion-header:hover {
  background: var(--bg-card-hover);
}

.accordion-header-main {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.accordion-chevron-btn {
  background: none;
  border: none;
  color: var(--text-subtle);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3px;
  border-radius: var(--radius-sm);
  transition: all var(--trans-fast);
}

.chevron-icon {
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.accordion-item.expanded .chevron-icon {
  transform: rotate(180deg);
  color: var(--accent-primary);
}

.accordion-title-box {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.accordion-id-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.run-mono-id {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text-main);
  background: var(--bg-card);
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: copy;
  transition: all var(--trans-fast);
}

.run-mono-id:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.accordion-date {
  font-size: 0.78rem;
  color: var(--text-subtle);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.accordion-header-metrics {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.metric-summary-pills {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.pill-count-muted {
  background: rgba(148, 163, 184, 0.1);
  color: var(--text-subtle);
  border: 1px solid var(--border-subtle);
}

.badge-partial {
  background: var(--brand-gold-bg);
  color: var(--brand-gold);
  border: 1px solid var(--brand-gold-border);
}

.btn-quick-download {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--text-main);
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  transition: all var(--trans-fast);
}

.btn-quick-download:hover {
  background: var(--accent-primary);
  color: #ffffff;
  border-color: var(--accent-primary);
}

/* Accordion Body */
.accordion-body {
  display: none;
  padding: 1.35rem 1.45rem 1.5rem;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-card);
  animation: fadeIn 0.2s ease;
}

.accordion-item.expanded .accordion-body {
  display: block;
}

.accordion-body-inner {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.section-micro-header {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--brand-gold);
  margin-bottom: 0.65rem;
}

.section-micro-header h4 {
  font-size: 0.84rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-main);
}

/* Download Cards Grid */
.files-download-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.85rem;
}

.download-file-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--text-main);
  transition: all var(--trans-fast);
}

.download-file-card:hover {
  border-color: var(--accent-primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px var(--accent-glow);
}

.file-card-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.file-tag-excel .file-card-icon {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
}

.file-tag-ko .file-card-icon {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.file-tag-sap .file-card-icon {
  background: rgba(23, 151, 192, 0.15);
  color: var(--accent-primary);
}

.file-card-details {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}

.file-card-name {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-card-size {
  font-size: 0.72rem;
  color: var(--text-subtle);
}

.file-card-action {
  color: var(--text-subtle);
  transition: color var(--trans-fast);
}

.download-file-card:hover .file-card-action {
  color: var(--accent-primary);
}

/* Steps Table */
.steps-table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.steps-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}

.steps-table th {
  background: var(--bg-surface);
  color: var(--text-subtle);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  padding: 0.65rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
}

.steps-table td {
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-main);
  vertical-align: middle;
}

.steps-table tbody tr:last-child td {
  border-bottom: none;
}

.steps-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

html[data-theme="light"] .steps-table tbody tr:hover {
  background: rgba(0, 0, 0, 0.02);
}

.step-cell-name strong {
  display: block;
  font-size: 0.84rem;
}

.step-cell-sub {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-subtle);
}

.step-mini-pill {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
}

.step-pill-completed {
  background: var(--status-success-bg);
  color: var(--status-success);
}

.step-pill-failed {
  background: var(--status-danger-bg);
  color: var(--status-danger);
}

.step-pill-empty {
  background: rgba(148, 163, 184, 0.1);
  color: var(--text-subtle);
}

.step-cell-count {
  font-family: var(--font-mono);
  font-weight: 600;
}

.cell-progress-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 100px;
}

.cell-progress-bar {
  flex: 1;
  height: 5px;
  background: var(--border-subtle);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.cell-progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
}

.cell-rate-text {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  width: 28px;
  text-align: right;
}

.error-inline {
  font-size: 0.78rem;
  color: #f87171;
  background: rgba(239, 68, 68, 0.12);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  display: inline-block;
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.empty-history-state,
.history-loading-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 3rem 1.5rem;
  text-align: center;
  color: var(--text-muted);
}

.history-loading-placeholder {
  flex-direction: row;
}

.spinning {
  animation: spin 0.8s linear infinite;
}

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */
@media (max-width: 860px) {
  .charts-duo-grid {
    grid-template-columns: 1fr;
  }
  .dashboard-header-banner {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 640px) {
  .app-main { padding: 0 1rem; }
  .stepper-bar { display: none; }
  .nav-menu { display: none; }
  .panel-header { flex-direction: column; align-items: flex-start; }
  .org-selector-row { flex-direction: column; width: 100%; }
  .org-selector-row .btn { width: 100%; }
  .files-grid { grid-template-columns: 1fr; }
  .history-controls { flex-direction: column; width: 100%; }
  .search-input-box, .filter-select-box { width: 100%; }
  .accordion-header { flex-direction: column; align-items: flex-start; }
  .accordion-header-metrics { width: 100%; justify-content: space-between; }
}

/* ==========================================================================
   Login Page & User Profile Pill
   ========================================================================== */
.login-body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-main);
  background-image: 
    radial-gradient(circle at 15% 20%, rgba(23, 151, 192, 0.12) 0%, transparent 40%),
    radial-gradient(circle at 85% 75%, rgba(222, 183, 108, 0.08) 0%, transparent 45%);
  position: relative;
  overflow-x: hidden;
}

.login-topbar {
  display: flex;
  justify-content: flex-end;
  padding: 1.25rem 2rem;
  z-index: 10;
}

.login-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  z-index: 5;
}

.login-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.6), 0 0 25px rgba(23, 151, 192, 0.1);
  padding: 2.25rem 2rem;
  backdrop-filter: blur(16px);
  position: relative;
  overflow: hidden;
  animation: loginFadeUp 0.4s ease-out;
}

.login-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--brand-primary) 0%, var(--brand-gold) 100%);
}

@keyframes loginFadeUp {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.login-header {
  text-align: center;
  margin-bottom: 2rem;
}

.login-logo-container {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  padding: 8px 18px;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
  margin-bottom: 1.25rem;
}

.login-logo-container img {
  height: 34px;
  width: auto;
  display: block;
}

.login-title {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--text-main);
  margin-bottom: 0.35rem;
}

.login-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

.login-presets {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  background: var(--bg-card);
  padding: 6px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
}

.login-preset-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.45rem 0.75rem;
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--trans-fast);
}

.login-preset-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.login-preset-btn.active {
  background: var(--brand-primary);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(23, 151, 192, 0.35);
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.login-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.login-field label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
}

.login-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.login-input-icon {
  position: absolute;
  left: 0.95rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-subtle);
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.login-input-wrapper input.login-input,
input.login-input {
  width: 100%;
  padding-left: 2.85rem !important;
  padding-right: 2.85rem !important;
  padding-top: 0.75rem !important;
  padding-bottom: 0.75rem !important;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 0.92rem;
  font-family: inherit;
  transition: all var(--trans-fast);
}

.login-input-wrapper input.login-input:focus,
input.login-input:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(23, 151, 192, 0.25);
  background: var(--bg-card);
}

.login-toggle-password {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-subtle);
  padding: 0.35rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition: color var(--trans-fast);
}

.login-toggle-password:hover {
  color: var(--text-main);
}

.login-error-box {
  background: var(--status-danger-bg);
  border: 1px solid var(--status-danger-border);
  color: var(--status-danger);
  padding: 0.65rem 0.9rem;
  border-radius: var(--radius-md);
  font-size: 0.83rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  animation: shake 0.35s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.login-btn-submit {
  width: 100%;
  padding: 0.85rem;
  margin-top: 0.5rem;
  background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-primary-hover) 100%);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  box-shadow: 0 4px 14px rgba(23, 151, 192, 0.35);
  transition: all var(--trans-fast);
}

.login-btn-submit:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(23, 151, 192, 0.45);
}

.login-btn-submit:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.login-footer-hint {
  margin-top: 1.5rem;
  text-align: center;
  font-size: 0.77rem;
  color: var(--text-subtle);
  border-top: 1px solid var(--border-subtle);
  padding-top: 1rem;
}

.login-footer-hint code {
  background: var(--bg-card);
  padding: 0.15rem 0.4rem;
  border-radius: var(--radius-sm);
  color: var(--brand-gold);
  font-family: var(--font-mono);
}

/* User Pill in Navbar */
.user-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 0.25rem 0.35rem 0.25rem 0.65rem;
  font-size: 0.82rem;
  transition: all var(--trans-fast);
}

.user-avatar-icon {
  display: flex;
  align-items: center;
  color: var(--brand-primary);
}

.user-pill-name {
  font-weight: 700;
  color: var(--text-main);
}

.user-pill-role {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
  padding: 0.1rem 0.45rem;
  border-radius: var(--radius-full);
  background: rgba(23, 151, 192, 0.15);
  color: var(--brand-primary-light);
  border: 1px solid rgba(23, 151, 192, 0.3);
}

.user-pill-role.role-masterdata {
  background: var(--brand-gold-bg);
  color: var(--brand-gold);
  border-color: var(--brand-gold-border);
}

.btn-logout {
  width: 26px;
  height: 26px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  color: var(--text-muted);
  transition: all var(--trans-fast);
}

.btn-logout:hover {
  background: var(--status-danger-bg);
  color: var(--status-danger);
}
