:root {
  --bg-dark: #0b0f19;
  --panel-bg: rgba(15, 23, 42, 0.75);
  --border-color: rgba(51, 65, 85, 0.8);
  --accent-blue: #3b82f6;
  --accent-cyan: #38bdf8;
  --accent-green: #34d399;
  --accent-red: #ef4444;
  --text-muted: #94a3b8;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
  background-color: var(--bg-dark);
  background-image: 
    radial-gradient(at 0% 0%, rgba(59, 130, 246, 0.12) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(14, 165, 233, 0.1) 0px, transparent 50%);
  background-attachment: fixed;
  color: #f8fafc;
  min-height: 100vh;
  padding-bottom: 2rem;
}

/* Glassmorphism Navbar */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 1.5rem;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-logo {
  font-size: 1.6rem;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-text h1 {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.brand-text p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.nav-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.badge-status {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}

.badge-online {
  background: rgba(52, 211, 153, 0.15);
  color: var(--accent-green);
  border: 1px solid rgba(52, 211, 153, 0.3);
}

.badge-offline {
  background: rgba(239, 68, 68, 0.15);
  color: var(--accent-red);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: currentColor;
}

/* Tabs Bar */
.nav-tabs {
  display: flex;
  background: rgba(15, 23, 42, 0.6);
  border-bottom: 1px solid var(--border-color);
  padding: 0 1.5rem;
  gap: 0.5rem;
  overflow-x: auto;
  scrollbar-width: thin;
}

.nav-tab {
  padding: 0.85rem 1.25rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 44px; /* Touch friendly minimum height */
}

.nav-tab.active, .nav-tab:hover {
  color: #ffffff;
  border-bottom-color: var(--accent-cyan);
  background: rgba(255, 255, 255, 0.03);
}

/* Container & Cards */
.container {
  max-width: 1440px;
  margin: 1.5rem auto;
  padding: 0 1.25rem;
}

.glass-card {
  background: var(--panel-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  margin-bottom: 1.5rem;
}

.card-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #fff;
}

.view-section {
  display: none;
}

.view-section.active {
  display: block;
  animation: fadeIn 0.25s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Work Order & Line Filter Header Bar */
.wo-header-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.6rem;
  background: rgba(30, 41, 59, 0.4);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.55rem 0.75rem;
  margin-bottom: 0.6rem;
}

/* 2D Factory Layout Grid Canvas */
.factory-layout-canvas {
  position: relative;
  width: 100%;
  min-height: 540px;
  background-color: #0b1120;
  background-image: 
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 25px 25px;
  border: 1px solid var(--border-color);
  border-radius: 14px;
  overflow: auto; /* Touch scroll enabled */
  padding: 1rem;
}

.factory-layout-canvas.edit-mode-active {
  background-color: #0a1329;
  border-color: rgba(56, 189, 248, 0.5);
  box-shadow: inset 0 0 20px rgba(56, 189, 248, 0.1);
}

/* 2D Canvas Node Card Object */
.canvas-node-card {
  position: absolute;
  width: 225px;
  background: rgba(15, 23, 42, 0.95);
  border: 2px solid var(--border-color);
  border-radius: 12px;
  padding: 0.85rem;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
  transition: box-shadow 0.2s, border-color 0.2s;
  cursor: pointer;
  user-select: none;
  touch-action: none;
  z-index: 10;
}

.canvas-node-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(56, 189, 248, 0.3);
  border-color: var(--accent-cyan);
}

.canvas-node-card.edit-mode {
  cursor: move;
  border-style: dashed;
}

.canvas-node-card.dragging {
  opacity: 0.85;
  z-index: 100;
  box-shadow: 0 15px 35px rgba(56, 189, 248, 0.6);
  border-color: var(--accent-cyan);
}

.canvas-node-card.status-ok { border-left: 5px solid var(--accent-green); }
.canvas-node-card.status-due { border-left: 5px solid #facc15; }
.canvas-node-card.status-ng { border-left: 5px solid var(--accent-red); }

.process-seq-badge {
  position: absolute;
  top: -10px;
  left: 12px;
  background: linear-gradient(135deg, #1e293b, #0f172a);
  border: 1px solid var(--border-color);
  color: var(--accent-cyan);
  font-size: 0.7rem;
  font-weight: 800;
  padding: 0.15rem 0.5rem;
  border-radius: 10px;
  font-family: monospace;
}

/* Form Controls & Buttons */
.btn-primary {
  background: linear-gradient(135deg, var(--accent-blue), #2563eb);
  color: #fff;
  border: none;
  padding: 0.65rem 1.25rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
  min-height: 44px; /* Touch target standard */
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-primary:hover {
  filter: brightness(1.15);
  box-shadow: 0 4px 15px rgba(37, 99, 235, 0.4);
}

.btn-select {
  background: rgba(30, 41, 59, 0.8);
  color: #fff;
  border: 1px solid var(--border-color);
  padding: 0.5rem 0.85rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  min-height: 40px;
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(11, 15, 25, 0.85);
  backdrop-filter: blur(8px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  padding: 1rem;
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  background: #0f172a;
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.5rem;
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 40px rgba(0,0,0,0.6);
}

/* Kanban CAPA Board */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
}

.kanban-col {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1rem;
  min-height: 380px;
}

.kanban-col-title {
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
}

.capa-card {
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 0.85rem;
  margin-bottom: 0.85rem;
  cursor: pointer;
  transition: transform 0.15s;
}

.capa-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-cyan);
}

/* Audit Item Check Controls */
.audit-item-row {
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 0.85rem;
}

.audit-controls {
  display: flex;
  gap: 0.6rem;
  margin-top: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

.btn-audit {
  flex: 1;
  min-width: 80px;
  padding: 0.65rem 0.5rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: rgba(15, 23, 42, 0.8);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  min-height: 44px;
}

.btn-audit.selected.btn-pass { background: #059669; border-color: #34d399; }
.btn-audit.selected.btn-fail { background: #dc2626; border-color: #fca5a5; }
.btn-audit.selected.btn-na { background: #475569; border-color: #94a3b8; }

/* ========== UNIFIED FILTER TOOLBAR ========== */
.filter-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 5px 10px;
  margin-bottom: 0.6rem;
  overflow-x: auto;
  flex-wrap: nowrap;
}

.toolbar-divider {
  width: 1px;
  height: 22px;
  background: rgba(148, 163, 184, 0.2);
  flex-shrink: 0;
  margin: 0 2px;
}

.toolbar-action-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.2), rgba(59, 130, 246, 0.15));
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #38bdf8;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.toolbar-action-btn:hover {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.35), rgba(59, 130, 246, 0.3));
  border-color: rgba(56, 189, 248, 0.7);
}

.toolbar-stats {
  margin-left: auto;
  font-size: 0.68rem;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
  padding: 0 4px;
}

/* ========== FILTER CHIPS (Phase, Standard, Area) ========== */
.filter-chip {
  padding: 3px 8px;
  background: transparent;
  border: 1px solid rgba(148, 163, 184, 0.2);
  color: #64748b;
  border-radius: 5px;
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  line-height: 1.4;
}

.filter-chip:hover {
  border-color: rgba(148, 163, 184, 0.5);
  color: #cbd5e1;
}

.filter-chip--phase.active {
  background: rgba(52, 211, 153, 0.15);
  color: #34d399;
  border-color: rgba(52, 211, 153, 0.5);
}

.filter-chip--std.active {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.5);
}

.filter-chip--area.active {
  background: rgba(251, 191, 36, 0.12);
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.4);
}

/* Legacy class compat for JS that still uses old class names */
.area-tab-btn, .std-tab-btn, .phase-tab-btn {
  padding: 3px 8px;
  background: transparent;
  border: 1px solid rgba(148, 163, 184, 0.2);
  color: #64748b;
  border-radius: 5px;
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.area-tab-btn:hover, .std-tab-btn:hover, .phase-tab-btn:hover {
  border-color: rgba(148, 163, 184, 0.5);
  color: #cbd5e1;
}

.area-tab-btn.active {
  background: rgba(251, 191, 36, 0.12);
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.4);
}

.std-tab-btn.active {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.5);
}

.phase-tab-btn.active {
  background: rgba(52, 211, 153, 0.15);
  color: #34d399;
  border-color: rgba(52, 211, 153, 0.5);
}

/* ========== LAYOUT MODE SWITCHER ========== */
.layout-mode-btn {
  padding: 5px 12px;
  background: transparent;
  border: 1px solid transparent;
  color: #64748b;
  border-radius: 7px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.layout-mode-btn:hover {
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.04);
}

.layout-mode-btn.active {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.2), rgba(59, 130, 246, 0.2));
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.5);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.15);
}

/* ==========================================================================
   OPTION 1: LINEAR CONVEYOR DIGITAL TWIN FLOW STYLES
   ========================================================================== */
.linear-conveyor-container {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: 0.5rem 0;
}

.line-progress-strip {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.conveyor-scroll-track {
  display: flex;
  gap: 1.25rem;
  overflow-x: auto;
  padding: 1rem 0.5rem 1.5rem 0.5rem;
  position: relative;
  scrollbar-width: thin;
  scrollbar-color: #38bdf8 rgba(15, 23, 42, 0.6);
}

.conveyor-belt-line {
  position: absolute;
  top: 50%;
  left: 20px;
  right: 20px;
  height: 4px;
  background: repeating-linear-gradient(90deg, #38bdf8, #38bdf8 15px, transparent 15px, transparent 30px);
  opacity: 0.3;
  z-index: 1;
}

.machine-flow-card {
  position: relative;
  z-index: 2;
  min-width: 250px;
  max-width: 260px;
  background: rgba(15, 23, 42, 0.95);
  border: 2px solid var(--border-color);
  border-radius: 16px;
  padding: 1.1rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.machine-flow-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 15px 35px rgba(56, 189, 248, 0.3);
  border-color: var(--accent-cyan);
}

.machine-flow-card.status-pending {
  border-top: 4px solid #64748b;
  background: rgba(15, 23, 42, 0.75);
}

.machine-flow-card.status-ok {
  border-top: 4px solid var(--accent-green);
  background: linear-gradient(180deg, rgba(5, 150, 105, 0.12) 0%, rgba(15, 23, 42, 0.95) 40%);
}

.machine-flow-card {
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid var(--border-color);
  user-select: none;
}

.machine-flow-card:hover {
  border-color: rgba(56, 189, 248, 0.6) !important;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.machine-flow-card.active-selected-node {
  border-color: #38bdf8 !important;
  background: linear-gradient(180deg, rgba(56, 189, 248, 0.18) 0%, rgba(15, 23, 42, 0.98) 50%) !important;
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.35), inset 0 0 12px rgba(56, 189, 248, 0.15) !important;
}

.machine-flow-card.status-due {
  border-top: 4px solid #facc15;
  background: linear-gradient(180deg, rgba(250, 204, 21, 0.12) 0%, rgba(15, 23, 42, 0.95) 40%);
}

.machine-flow-card.status-ng {
  border-top: 4px solid var(--accent-red);
  background: linear-gradient(180deg, rgba(239, 68, 68, 0.15) 0%, rgba(15, 23, 42, 0.95) 40%);
}

.machine-icon-block {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(30, 41, 59, 0.9);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.spec-parameter-pill {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 0.35rem 0.5rem;
  font-size: 0.72rem;
  color: #cbd5e1;
  font-family: monospace;
}

/* ==========================================================================
   OPTION 3: SHOPFLOOR MULTI-LINE BAY MATRIX STYLES
   ========================================================================== */
.bay-matrix-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

@media (max-width: 1024px) {
  .bay-matrix-container {
    grid-template-columns: 1fr;
  }
}

.bay-column {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 1.25rem;
}

.bay-header-title {
  font-size: 1rem;
  font-weight: 800;
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
}

.line-track-row {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  margin-bottom: 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.line-track-row:hover {
  background: rgba(51, 65, 85, 0.9);
  border-color: var(--accent-cyan);
  transform: translateX(3px);
}

.led-matrix {
  display: flex;
  gap: 5px;
  align-items: center;
}

.led-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  box-shadow: 0 0 6px rgba(0,0,0,0.5);
}

.led-dot.pending {
  background: #334155;
  border: 1px solid rgba(148, 163, 184, 0.4);
  box-shadow: none;
}

.led-dot.ok {
  background: #34d399;
  box-shadow: 0 0 8px rgba(52, 211, 153, 0.8);
}

.led-dot.due {
  background: #facc15;
  box-shadow: 0 0 8px rgba(250, 204, 21, 0.8);
}

.led-dot.ng {
  background: #ef4444;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.9);
  animation: pulse-ng 1.2s infinite ease-in-out;
}

@keyframes pulse-ng {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.7; }
}

/* ==========================================================================
   MULTI-DEVICE RESPONSIVE BREAKPOINTS (Mobile, Tablet, Desktop)
   ========================================================================== */


/* ==========================================================================
   RESPONSIVE LAYOUT (Mobile & Tablet Optimization)
   ========================================================================== */

/* Tablet & Smaller Desktops (<= 1024px) */
@media (max-width: 1024px) {
  .navbar { padding: 0.75rem 1rem; }
  .container { padding: 0 0.85rem; }
  .kanban-board { grid-template-columns: 1fr 1fr; }
  .filter-toolbar {
    padding: 6px;
    gap: 4px;
  }
  .filter-chip {
    padding: 3px 8px;
    font-size: 0.65rem;
  }
  .toolbar-stats {
    font-size: 0.6rem;
  }
}

/* Mobile & Touchscreens (<= 768px) */
@media (max-width: 768px) {
  .navbar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }
  .nav-controls {
    justify-content: space-between;
    width: 100%;
  }
  .card-title {
    font-size: 1.05rem;
  }
  .wo-header-bar {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
  .kanban-board {
    grid-template-columns: 1fr;
  }
  .modal-content {
    padding: 1rem;
    width: 95%;
  }
  .factory-layout-canvas {
    min-height: 400px;
  }
  
  /* Header UI Refinements for Mobile */
  .layout-mode-tabs {
    width: 100%;
    justify-content: space-between;
  }
  .layout-mode-btn {
    flex: 1;
    text-align: center;
    padding: 6px 4px;
    font-size: 0.7rem;
  }
  
  .filter-toolbar {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
    scrollbar-width: none; /* Firefox */
  }
  .filter-toolbar::-webkit-scrollbar {
    display: none; /* Safari and Chrome */
  }
}
.canvas-node-card.status-partial { border-left: 5px solid #facc15; }
.machine-flow-card.status-partial { border-top: 4px solid #facc15; background: linear-gradient(180deg, rgba(250, 204, 21, 0.12) 0%, rgba(15, 23, 42, 0.95) 40%); }

.led-dot.partial { background: #facc15; box-shadow: 0 0 8px rgba(250, 204, 21, 0.8); }

/* ==========================================================================
   CINEMATIC UNLOCK SPLASH OVERLAY
   ========================================================================== */
.unlock-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at center, rgba(15, 23, 42, 0.98) 0%, rgba(2, 6, 23, 0.99) 100%);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.unlock-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.unlock-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  animation: unlockZoomIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes unlockZoomIn {
  0% { transform: scale(0.6); opacity: 0; }
  60% { transform: scale(1.35); opacity: 1; }
  100% { transform: scale(1.2); opacity: 1; }
}

.unlock-glow-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.3) 0%, rgba(52, 211, 153, 0) 70%);
  filter: blur(25px);
  pointer-events: none;
  transition: all 0.6s ease;
}

.unlock-overlay.unlocked .unlock-glow-ring {
  background: radial-gradient(circle, rgba(52, 211, 153, 0.5) 0%, rgba(52, 211, 153, 0) 70%);
  transform: translate(-50%, -50%) scale(1.5);
}

.unlock-icon-wrap {
  position: relative;
  z-index: 2;
  filter: drop-shadow(0 12px 30px rgba(0, 0, 0, 0.6));
}

.padlock-svg {
  display: block;
  overflow: visible;
  transition: all 0.5s ease;
}

.padlock-shackle {
  transition: transform 0.7s cubic-bezier(0.34, 1.56, 0.64, 1), stroke 0.4s ease;
  transform-origin: 32px 30px;
}

.padlock-body {
  transition: stroke 0.4s ease;
}

.padlock-keyhole {
  transition: fill 0.4s ease;
}

.padlock-svg.unlocked .padlock-shackle {
  transform: translateY(-20px) rotate(-24deg);
  stroke: #34d399 !important;
}

.padlock-svg.unlocked .padlock-body {
  stroke: #34d399 !important;
}

.padlock-svg.unlocked .padlock-keyhole {
  fill: #34d399 !important;
}

.unlock-text-group {
  margin-top: 2rem;
  text-align: center;
  animation: unlockFadeUp 0.6s ease 0.3s forwards;
  opacity: 0;
  z-index: 2;
}

@keyframes unlockFadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.unlock-title {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 2.5px;
  color: #38bdf8;
  text-shadow: 0 0 20px rgba(56, 189, 248, 0.4);
  text-transform: uppercase;
  transition: all 0.4s ease;
}

.unlock-overlay.unlocked .unlock-title {
  color: #34d399;
  text-shadow: 0 0 25px rgba(52, 211, 153, 0.6);
}

.unlock-subtitle {
  font-size: 0.9rem;
  color: #94a3b8;
  margin-top: 0.4rem;
  font-weight: 500;
}

input, select, textarea { color: #f8fafc; color-scheme: dark; border-color: rgba(148, 163, 184, 0.4); outline: none; }
input::placeholder, textarea::placeholder { color: #64748b; }

.login-input { padding: 0.6rem 0.85rem; border-radius: 8px; border: 1px solid var(--border-color); background: rgba(15,23,42,0.8); color: #fff; width: 100%; font-size: 0.9rem; }
.login-input:focus { border-color: var(--accent-cyan); box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2); }

/* Audit Dashboard Integrated Sub-Views Switcher */
.dash-subview-nav {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 1.25rem;
  background: rgba(15, 23, 42, 0.85);
  padding: 6px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  flex-wrap: wrap;
}

.dash-sub-tab {
  flex: 1;
  min-width: 180px;
  padding: 0.65rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: rgba(15, 23, 42, 0.6);
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.dash-sub-tab:hover {
  background: rgba(30, 41, 59, 0.8);
  color: #fff;
  border-color: rgba(56, 189, 248, 0.4);
}

.dash-sub-tab.active {
  background: rgba(56, 189, 248, 0.18);
  border-color: #38bdf8;
  color: #38bdf8;
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.2);
}

/* ====== Overdue Audit Banner Pulse ====== */
@keyframes overduePulse {
  0%, 100% { box-shadow: 0 4px 20px rgba(220, 38, 38, 0.7); }
  50%       { box-shadow: 0 4px 32px rgba(220, 38, 38, 1), 0 0 0 4px rgba(220,38,38,0.25); }
}
#overdue-audit-toast {
  animation: overduePulse 1.8s ease-in-out infinite;
}

