/* ==============================================================================
   TCMC MCC WASTE MANAGEMENT - INDUSTRIAL LIGHT EDITION
   Aesthetic: Clean Modern Industrial SCADA / High-Visibility Precision Terminal
   ============================================================================== */

:root {
  /* High-Contrast Light Industrial Palette */
  --bg-darkest: #f1f5f9;       /* Slate 100 base ground */
  --bg-deep: #f8fafc;          /* Slate 50 clean surface */
  --bg-panel: #ffffff;         /* Pure crisp white card/panel */
  --bg-panel-hover: #f8fafc;   /* Subtle highlight on hover */
  --bg-subtle: #f1f5f9;        /* Soft inset background */
  --bg-input: #ffffff;         /* Clean form input */

  --panel-border: #e2e8f0;     /* Slate 200 crisp border */
  --panel-border-bright: #cbd5e1; /* Slate 300 active/highlight border */

  --text-main: #0f172a;        /* Slate 900 primary text - high contrast */
  --text-muted: #475569;       /* Slate 600 secondary text */
  --text-dim: #64748b;         /* Slate 500 tertiary/helper text */

  /* 3-Phase Color Standard - High Contrast on Light Backgrounds */
  --color-r: #e11d48;          /* Vibrant Ruby Red */
  --color-y: #d97706;          /* Golden Amber */
  --color-b: #2563eb;          /* Royal Sapphire Blue */
  --color-avg: #059669;        /* Deep Emerald Green */

  /* Operational State Colors */
  --status-off: #dc2626;       /* Red 600 */
  --status-idle: #d97706;      /* Amber 600 */
  --status-load: #059669;      /* Emerald 600 */
  --status-check: #0284c7;     /* Sky 600 */

  /* Alarms */
  --alarm-critical: #dc2626;
  --alarm-warning: #d97706;
  --alarm-info: #2563eb;

  /* Elevation & Shadows */
  --shadow-scada: 0 4px 20px -2px rgba(15, 23, 42, 0.07), 0 2px 6px -1px rgba(15, 23, 42, 0.04);
  --shadow-card-hover: 0 12px 28px -4px rgba(15, 23, 42, 0.12), 0 4px 10px -2px rgba(15, 23, 42, 0.06);
  --glow-cyan: 0 0 16px rgba(2, 132, 199, 0.25);
}

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

html, body {
  height: 100%;
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg-darkest);
  background-image: radial-gradient(circle at 50% 0%, #e2e8f0 0%, #f1f5f9 65%, #e2e8f0 100%);
  background-attachment: fixed;
  color: var(--text-main);
  overflow-x: hidden;
}

/* ==============================================================================
   VIEW CONTAINERS
   ============================================================================== */
.scada-app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ==============================================================================
   LOGIN GATEWAY - VAE WASTE SHREDDER REFERENCE DESIGN (CYBER-INDUSTRIAL BLUE)
   ============================================================================== */
.vae-login-viewport {
  min-height: 100vh;
  width: 100vw;
  display: flex;
  position: relative;
  overflow-x: hidden;
  background: #040e1f;
  font-family: 'Outfit', sans-serif;
}

/* Background Ambient Lighting & Curved Glow */
.vae-login-viewport::before {
  content: "";
  position: absolute;
  top: -150px;
  right: -150px;
  width: 700px;
  height: 700px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 119, 255, 0.22) 0%, rgba(2, 132, 199, 0.08) 50%, transparent 70%);
  pointer-events: none;
  z-index: 1;
}

.vae-login-viewport::after {
  content: "";
  position: absolute;
  bottom: -200px;
  left: 20%;
  width: 800px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(14, 165, 233, 0.12) 0%, transparent 70%);
  pointer-events: none;
  z-index: 1;
}

/* Left Showcase Area */
.vae-showcase-pane {
  flex: 1.25;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 40px;
  background: url('/images/shredder_left_hero.jpg') center center / cover no-repeat;
  overflow: hidden;
}

/* Top Brand Badge on Showcase Pane */
.vae-showcase-top-brand {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 16px;
  padding: 10px 18px;
  background: rgba(5, 17, 38, 0.78);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(56, 189, 248, 0.28);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  align-self: flex-start;
  animation: vaeFadeIn 0.5s ease;
}

.vae-showcase-brand-logo {
  height: 32px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 2px 10px rgba(56, 189, 248, 0.5));
}

.vae-showcase-brand-divider {
  width: 1px;
  height: 26px;
  background: rgba(56, 189, 248, 0.35);
}

.vae-showcase-brand-text {
  display: flex;
  flex-direction: column;
}

.vae-showcase-brand-main {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #ffffff;
  text-transform: uppercase;
}

.vae-showcase-brand-sub {
  font-size: 11px;
  font-weight: 600;
  color: #38bdf8;
  letter-spacing: 0.5px;
}

/* Vignette gradient overlay so it fades seamlessly into the right dark pane */
.vae-showcase-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(4, 14, 31, 0.1) 0%, rgba(4, 14, 31, 0.3) 60%, #040e1f 100%),
              linear-gradient(180deg, rgba(4, 14, 31, 0.15) 0%, transparent 40%, rgba(4, 14, 31, 0.6) 100%);
  pointer-events: none;
}

/* 5 Feature Badges at the bottom of the showcase */
.vae-feature-strip {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  background: rgba(5, 17, 38, 0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 20px;
  padding: 16px 20px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.vae-feature-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: transform 0.2s ease;
}

.vae-feature-item:hover {
  transform: translateY(-2px);
}

.vae-feature-icon-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(14, 165, 233, 0.22) 0%, rgba(2, 132, 199, 0.08) 100%);
  border: 1.5px solid rgba(56, 189, 248, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #38bdf8;
  box-shadow: 0 0 16px rgba(2, 132, 199, 0.35);
  transition: all 0.25s ease;
}

.vae-feature-item:hover .vae-feature-icon-circle {
  border-color: #38bdf8;
  box-shadow: 0 0 22px rgba(56, 189, 248, 0.6);
  color: #ffffff;
}

.vae-feature-label {
  font-size: 11px;
  font-weight: 700;
  color: #cbd5e1;
  margin-top: 8px;
  line-height: 1.3;
  max-width: 95px;
}

/* Right Authentication Area */
.vae-auth-pane {
  flex: 0.95;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 30px;
  position: relative;
  z-index: 2;
  background: radial-gradient(circle at 60% 50%, rgba(2, 132, 199, 0.12) 0%, transparent 65%),
              linear-gradient(135deg, #051329 0%, #071935 50%, #040f21 100%);
}

/* The Glassmorphism Login Card */
.vae-login-card {
  width: 100%;
  max-width: 440px;
  background: rgba(6, 21, 46, 0.82);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1.5px solid rgba(56, 189, 248, 0.36);
  border-radius: 24px;
  padding: 38px 36px 30px 36px;
  box-shadow: 0 25px 60px -10px rgba(0, 0, 0, 0.75), 0 0 35px rgba(2, 132, 199, 0.22);
  position: relative;
  overflow: hidden;
  animation: vaeFadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes vaeFadeIn {
  from { opacity: 0; transform: translateY(18px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.vae-login-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #38bdf8, #0084ff, transparent);
}

/* Card Header */
.vae-card-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 24px;
}

.vae-logo-img {
  height: 52px;
  width: auto;
  max-width: 220px;
  object-fit: contain;
  margin-bottom: 14px;
  filter: drop-shadow(0 4px 16px rgba(14, 165, 233, 0.55));
  transition: transform 0.25s ease, filter 0.25s ease;
}

.vae-logo-img:hover {
  transform: scale(1.03);
  filter: drop-shadow(0 6px 22px rgba(56, 189, 248, 0.75));
}

.vae-card-title {
  font-size: 20px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin: 0;
  text-align: center;
}

.vae-card-sub {
  font-size: 12px;
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  margin-top: 4px;
  text-align: center;
}

.vae-accent-line {
  width: 34px;
  height: 3px;
  background: #0084ff;
  border-radius: 2px;
  margin-top: 10px;
  box-shadow: 0 0 10px #0084ff;
}

/* Input Styles */
.vae-input-group {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 16px;
}

.vae-input-icon {
  position: absolute;
  left: 15px;
  color: #64748b;
  display: flex;
  align-items: center;
  pointer-events: none;
  z-index: 2;
  transition: color 0.2s;
}

.vae-input {
  width: 100%;
  background: rgba(9, 29, 61, 0.65);
  border: 1px solid rgba(56, 189, 248, 0.28);
  border-radius: 12px;
  color: #ffffff;
  font-size: 14px;
  font-family: inherit;
  padding: 13px 16px 13px 44px;
  outline: none;
  transition: all 0.2s ease;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
}

.vae-input.with-toggle {
  padding-right: 44px;
}

.vae-input::placeholder {
  color: #64748b;
}

.vae-input:focus {
  background: rgba(12, 38, 78, 0.85);
  border-color: #0084ff;
  box-shadow: 0 0 0 3px rgba(0, 132, 255, 0.25), inset 0 1px 3px rgba(0, 0, 0, 0.2);
}

.vae-input-group:focus-within .vae-input-icon {
  color: #38bdf8;
}

.vae-password-toggle {
  position: absolute;
  right: 12px;
  background: transparent;
  border: 0;
  color: #64748b;
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 4px;
  transition: color 0.2s;
  z-index: 2;
}

.vae-password-toggle:hover {
  color: #38bdf8;
}

/* Options Row */
.vae-options-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
  font-size: 12.5px;
}

.vae-checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #cbd5e1;
  cursor: pointer;
  user-select: none;
}

.vae-checkbox-label input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1.5px solid rgba(56, 189, 248, 0.4);
  background: rgba(9, 29, 61, 0.7);
  cursor: pointer;
  position: relative;
  transition: all 0.15s ease;
}

.vae-checkbox-label input[type="checkbox"]:checked {
  background: #0084ff;
  border-color: #0084ff;
}

.vae-checkbox-label input[type="checkbox"]:checked::after {
  content: "✓";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
}

.vae-forgot-link {
  color: #38bdf8;
  text-decoration: none;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s;
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
}

.vae-forgot-link:hover {
  color: #7dd3fc;
  text-decoration: underline;
}

/* Login Action Button */
.vae-login-btn {
  width: 100%;
  height: 48px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(90deg, #0077ff, #0099ff);
  color: #ffffff;
  font-size: 14.5px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 8px 24px rgba(0, 132, 255, 0.42);
  transition: all 0.2s ease;
  font-family: inherit;
}

.vae-login-btn:hover:not(:disabled) {
  background: linear-gradient(90deg, #0066ee, #0088ee);
  box-shadow: 0 12px 30px rgba(0, 132, 255, 0.6);
  transform: translateY(-1px);
}

.vae-login-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Card Bottom Micro-Badges */
.vae-card-badges {
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid rgba(56, 189, 248, 0.16);
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 12px;
}

.vae-card-badge-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  transition: color 0.2s;
}

.vae-card-badge-item:hover {
  color: #38bdf8;
}

.vae-card-badge-icon {
  color: #38bdf8;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Alert Banners */
.vae-error-alert {
  padding: 11px 14px;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  animation: vaeShake 0.3s ease;
}

.vae-info-alert {
  padding: 11px 14px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #7dd3fc;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

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



/* Mobile & Tablet Responsiveness */
@media (max-width: 992px) {
  .vae-login-viewport {
    flex-direction: column;
    overflow-y: auto;
  }
  .vae-showcase-pane {
    flex: none;
    min-height: 280px;
    padding: 20px;
  }
  .vae-feature-strip {
    display: none;
  }
  .vae-auth-pane {
    flex: none;
    padding: 24px 16px 40px;
  }
}

.input-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.input-field {
  width: 100%;
  padding: 14px 18px;
  border-radius: 12px;
  border: 1px solid var(--panel-border-bright);
  background: #ffffff;
  color: var(--text-main);
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: all 0.25s ease;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
}

.input-field:focus {
  border-color: #0284c7;
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(2, 132, 199, 0.15);
}

.btn-primary {
  width: 100%;
  padding: 15px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, #0284c7, #0ea5e9, #38bdf8);
  color: #fff;
  font-weight: 800;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  box-shadow: 0 10px 25px rgba(2, 132, 199, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(2, 132, 199, 0.45);
}

/* Input with Icon & Toggle Enhancements */
.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.input-prefix-icon {
  position: absolute;
  left: 16px;
  pointer-events: none;
  font-size: 16px;
  color: var(--text-dim);
  z-index: 2;
  user-select: none;
}

.input-field.has-icon {
  padding-left: 48px;
}

.input-field.has-toggle {
  padding-right: 48px;
}

.password-toggle-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: 0;
  cursor: pointer;
  font-size: 17px;
  padding: 6px 10px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all 0.2s;
  z-index: 2;
}

.password-toggle-btn:hover {
  background: rgba(15, 23, 42, 0.06);
  transform: translateY(-50%) scale(1.1);
}

.login-error-alert {
  padding: 12px 16px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.12);
  animation: shake 0.3s ease;
}

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

.login-submit-btn {
  margin-top: 10px;
}

.login-security-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid var(--panel-border);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-dim);
  letter-spacing: 0.5px;
  text-align: center;
}

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

/* ==============================================================================
   SCADA STATION HEADER & NAVIGATION
   ============================================================================== */
.scada-header {
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--panel-border);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 0 28px;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.04);
}

.header-top {
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.station-brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.station-brand-logo-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5px 12px;
  background: rgba(2, 132, 199, 0.05);
  border: 1px solid rgba(2, 132, 199, 0.16);
  border-radius: 12px;
  transition: all 0.2s ease;
}

.station-brand-logo-wrap:hover {
  background: rgba(2, 132, 199, 0.1);
  border-color: rgba(2, 132, 199, 0.32);
}

.station-brand-logo {
  height: 32px;
  width: auto;
  max-width: 130px;
  object-fit: contain;
  display: block;
}

.station-brand-divider {
  width: 1px;
  height: 30px;
  background: rgba(148, 163, 184, 0.35);
}

.station-logo {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #0284c7, #0ea5e9);
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 18px;
  color: #fff;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.35);
}

.station-title h1 {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--text-main);
}

.station-sub {
  font-size: 11px;
  color: #0284c7;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* SCADA Clock */
.scada-clock {
  font-family: 'Outfit', monospace;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--bg-subtle);
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--panel-border);
}

/* Connection Indicator */
.conn-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 800;
  padding: 6px 14px;
  border-radius: 20px;
  background: var(--bg-subtle);
  border: 1px solid var(--panel-border);
  transition: all 0.3s ease;
  letter-spacing: 0.5px;
}

.conn-indicator.online {
  color: #059669;
  border-color: rgba(16, 185, 129, 0.4);
  background: rgba(236, 253, 245, 0.85);
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.12);
}

.conn-indicator.offline {
  color: #dc2626;
  border-color: rgba(239, 68, 68, 0.4);
  background: rgba(254, 242, 242, 0.85);
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.12);
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 6px rgba(239, 68, 68, 0.6);
  transition: all 0.25s ease;
  flex-shrink: 0;
}

.dot.active {
  background: #10b981;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.8);
}

/* User Badge */
.user-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-subtle);
  padding: 4px 12px 4px 6px;
  border-radius: 24px;
  border: 1px solid var(--panel-border);
}

.user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #e2e8f0;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 13px;
  color: #0284c7;
}

.role-pill {
  font-size: 9px;
  text-transform: uppercase;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  color: #fff;
}
.role-pill.admin { background: linear-gradient(135deg, #7c3aed, #a855f7); }
.role-pill.supervisor { background: linear-gradient(135deg, #0284c7, #06b6d4); }
.role-pill.operator { background: linear-gradient(135deg, #059669, #10b981); }

/* Navigation Tabs Bar */
.scada-nav-tabs {
  display: flex;
  gap: 6px;
  border-top: 1px solid var(--panel-border);
  padding: 8px 0;
}

.nav-tab-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: inherit;
}

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

.nav-tab-btn.active {
  background: #e0f2fe;
  color: #0284c7;
  border-color: #bae6fd;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.15);
}

/* ==============================================================================
   MOBILE NAVIGATION DROPDOWN
   ============================================================================== */
.scada-mobile-nav {
  display: none; /* hidden on desktop screens */
  position: relative;
  padding: 8px 0;
  border-top: 1px solid var(--panel-border);
}

.mobile-nav-dropdown-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px 16px;
  background: #ffffff;
  border: 1.5px solid var(--panel-border-bright);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
}

.mobile-nav-dropdown-trigger:hover,
.mobile-nav-dropdown-trigger.open {
  border-color: #0284c7;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.12);
}

.mobile-nav-active-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 13.5px;
  color: var(--text-main);
  letter-spacing: 0.5px;
}

.mobile-nav-active-label .active-icon {
  font-size: 16px;
}

.mobile-nav-chevron {
  font-size: 11px;
  color: var(--text-dim);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-nav-chevron.open {
  transform: rotate(180deg);
  color: #0284c7;
}

/* Backdrop overlay to dismiss dropdown */
.mobile-dropdown-backdrop {
  position: fixed;
  inset: 0;
  z-index: 150;
  background: rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  animation: fadeInBackdrop 0.15s ease;
}

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

/* Floating dropdown card */
.mobile-nav-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 6px;
  background: #ffffff;
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  padding: 8px;
  box-shadow: 0 16px 36px -4px rgba(15, 23, 42, 0.16), 0 4px 12px rgba(15, 23, 42, 0.08);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 4px;
  animation: dropdownSlide 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes dropdownSlide {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.mobile-nav-option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 11px 14px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 800;
  font-family: inherit;
  color: var(--text-main);
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
}

.mobile-nav-option:hover {
  background: var(--bg-subtle);
}

.mobile-nav-option.active {
  background: #0284c7;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.3);
}

.mobile-nav-option .option-icon {
  font-size: 16px;
}

.mobile-nav-option .option-label {
  flex: 1;
}

.mobile-nav-option .option-check {
  font-size: 14px;
  font-weight: 900;
}

/* ==============================================================================
   WORKSPACE PANELS
   ============================================================================== */
main.scada-main {
  flex: 1;
  padding: 26px 28px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  max-width: 1680px;
  width: 100%;
  margin: 0 auto;
}

.panel {
  background: var(--bg-panel);
  border: 1px solid var(--panel-border);
  border-radius: 20px;
  padding: 24px;
  box-shadow: var(--shadow-scada);
  position: relative;
  overflow: hidden;
}

.panel::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(15, 23, 42, 0.05), transparent);
}

/* Mimic Status Banner */
.status-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 32px;
}

.caption {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-muted);
}

.status-display {
  font-size: 36px;
  font-weight: 900;
  margin-top: 6px;
  letter-spacing: 1px;
}
.status-display.off { color: var(--status-off); }
.status-display.idle { color: var(--status-idle); }
.status-display.load { color: var(--status-load); }
.status-display.check { color: var(--status-check); }
.status-display.no { color: var(--status-off); animation: pulseError 1.5s infinite; }

@keyframes pulseError { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }

/* 3-Phase Cards */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.phase-card {
  background: var(--bg-panel);
  border: 1px solid var(--panel-border);
  border-radius: 18px;
  padding: 22px;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.phase-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-card-hover);
  border-color: var(--panel-border-bright);
}

.phase-tag {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.reading-val {
  font-size: 40px;
  font-weight: 900;
  margin-top: 14px;
  color: var(--text-main);
  font-variant-numeric: tabular-nums;
}
.reading-val span {
  font-size: 15px;
  color: var(--text-muted);
  font-weight: 600;
}

.phase-track {
  height: 8px;
  background: #f1f5f9;
  border-radius: 8px;
  margin-top: 16px;
  overflow: hidden;
  border: 1px solid var(--panel-border);
}

.phase-fill {
  height: 100%;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 8px;
}

/* ==============================================================================
   TRENDS SCADA SECTION
   ============================================================================== */
.trends-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.trends-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.time-btn-group {
  display: flex;
  background: var(--bg-subtle);
  padding: 4px;
  border-radius: 10px;
  border: 1px solid var(--panel-border);
}

.time-btn {
  background: transparent;
  border: 0;
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}

.time-btn.active {
  background: #0284c7;
  color: #fff;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.3);
}

.trend-canvas-wrap {
  width: 100%;
  height: 380px;
  position: relative;
  background: #ffffff;
  border-radius: 14px;
  border: 1px solid var(--panel-border);
  padding: 14px;
  box-shadow: inset 0 1px 3px rgba(15, 23, 42, 0.03);
}

.trend-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 18px;
}

.kpi-tile {
  background: var(--bg-subtle);
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  padding: 16px 20px;
}
.kpi-tile-label { font-size: 11px; text-transform: uppercase; color: var(--text-muted); font-weight: 700; letter-spacing: 1px; }
.kpi-tile-val { font-size: 24px; font-weight: 800; color: var(--text-main); margin-top: 4px; }

/* ==============================================================================
   REPORTS HUB
   ============================================================================== */
.reports-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  background: #ffffff;
  padding: 18px 24px;
  border-radius: 16px;
  border: 1px solid var(--panel-border);
  margin-bottom: 24px;
  box-shadow: var(--shadow-scada);
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.btn-export {
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
  border: 1px solid transparent;
}

.btn-excel {
  background: linear-gradient(135deg, #059669, #10b981);
  color: #fff;
  box-shadow: 0 4px 14px rgba(5, 150, 105, 0.25);
}
.btn-excel:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(5, 150, 105, 0.4); }

.btn-pdf {
  background: linear-gradient(135deg, #dc2626, #ef4444);
  color: #fff;
  box-shadow: 0 4px 14px rgba(220, 38, 38, 0.25);
}
.btn-pdf:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(220, 38, 38, 0.4); }

.scada-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: var(--shadow-scada);
}

.scada-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

.scada-table th {
  background: #f8fafc;
  padding: 14px 18px;
  font-weight: 800;
  color: var(--text-muted);
  letter-spacing: 1px;
  text-transform: uppercase;
  font-size: 11px;
  border-bottom: 1px solid var(--panel-border);
}

.scada-table td {
  padding: 14px 18px;
  border-top: 1px solid var(--panel-border);
  color: var(--text-main);
}

.scada-table tr:hover td {
  background: #f8fafc;
}

/* Reports Hub: Period & Interval Selectors */
.report-period-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding: 8px 12px;
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid var(--panel-border);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.report-period-btn {
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  border: 1px solid var(--panel-border);
  background: var(--bg-subtle);
  color: var(--text-muted);
  transition: all 0.2s ease;
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 6px;
}

.report-period-btn:hover {
  background: #e2e8f0;
  color: var(--text-main);
}

.report-period-btn.active {
  background: linear-gradient(135deg, #0284c7, #0ea5e9);
  color: #fff;
  border-color: #0284c7;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.3);
}

.report-interval-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 18px;
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid var(--panel-border);
  margin-bottom: 20px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.report-interval-label {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #0284c7;
  display: flex;
  align-items: center;
  gap: 6px;
}

.report-interval-pills {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.interval-pill-btn {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  border: 1px solid var(--panel-border);
  background: var(--bg-subtle);
  color: var(--text-muted);
  transition: all 0.15s ease;
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 5px;
}

.interval-pill-btn:hover {
  background: #e2e8f0;
  color: var(--text-main);
  transform: translateY(-1px);
}

.interval-pill-btn.active {
  background: linear-gradient(135deg, #059669, #10b981);
  color: #fff;
  border-color: #059669;
  box-shadow: 0 2px 10px rgba(5, 150, 105, 0.3);
}

.state-badge {
  font-size: 10px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  text-transform: uppercase;
  display: inline-block;
  letter-spacing: 0.5px;
}

.state-badge.load {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.state-badge.idle {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
}

.state-badge.off {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.report-pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 18px;
  background: #f8fafc;
  border-top: 1px solid var(--panel-border);
  font-size: 12px;
  color: var(--text-muted);
}

.page-btn {
  padding: 5px 12px;
  border-radius: 6px;
  border: 1px solid var(--panel-border);
  background: #ffffff;
  color: var(--text-main);
  cursor: pointer;
  font-weight: 700;
  font-size: 12px;
  transition: all 0.2s;
}

.page-btn:hover:not(:disabled) {
  background: #e0f2fe;
  border-color: #0284c7;
  color: #0284c7;
}

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

/* ==============================================================================
   MACHINE GRAPHIC MIMIC & CONDITION VISUALIZATION (SHREDDER MACHINE)
   ============================================================================== */
.machine-mimic-card {
  background: var(--bg-panel);
  border: 1px solid var(--panel-border);
  border-radius: 24px;
  padding: 24px;
  box-shadow: var(--shadow-scada);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.machine-mimic-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, transparent, #0284c7, transparent);
}

.machine-mimic-card.state-off::before {
  background: linear-gradient(90deg, transparent, #dc2626, transparent);
}
.machine-mimic-card.state-idle::before {
  background: linear-gradient(90deg, transparent, #d97706, transparent);
}
.machine-mimic-card.state-load::before {
  background: linear-gradient(90deg, transparent, #059669, transparent);
}

/* Mimic Header Bar */
.machine-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  border-bottom: 1px solid var(--panel-border);
  padding-bottom: 16px;
}

.machine-title-group h2 {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 10px;
}

.machine-title-group .machine-specs-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.machine-condition-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: 30px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  transition: all 0.3s ease;
}

.machine-condition-pill.state-off {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  box-shadow: 0 2px 10px rgba(220, 38, 38, 0.12);
}

.machine-condition-pill.state-idle {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #b45309;
  box-shadow: 0 2px 10px rgba(217, 119, 6, 0.12);
}

.machine-condition-pill.state-load {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #047857;
  box-shadow: 0 2px 12px rgba(5, 150, 105, 0.15);
}

/* Machine Visual Stage */
.machine-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 36px 20px 28px;
  background: radial-gradient(ellipse at 50% 65%, #ffffff 0%, #f8fafc 55%, #f1f5f9 100%);
  border-radius: 20px;
  border: 1px solid var(--panel-border);
  overflow: hidden;
  min-height: 400px;
  box-shadow: inset 0 2px 10px rgba(15, 23, 42, 0.03);
}

/* SCADA Perspective Grid Floor */
.machine-stage-floor {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 140px;
  background-image: 
    linear-gradient(rgba(2, 132, 199, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(2, 132, 199, 0.1) 1px, transparent 1px);
  background-size: 28px 28px;
  transform: perspective(400px) rotateX(60deg);
  transform-origin: bottom center;
  pointer-events: none;
  opacity: 0.85;
}

/* Pedestal Radial Glow */
.pedestal-glow {
  position: absolute;
  bottom: 25px;
  width: 75%;
  max-width: 620px;
  height: 90px;
  border-radius: 50%;
  filter: blur(35px);
  pointer-events: none;
  transition: all 0.5s ease;
}

.state-off .pedestal-glow {
  background: rgba(220, 38, 38, 0.12);
}

.state-idle .pedestal-glow {
  background: rgba(217, 119, 6, 0.15);
}

.state-load .pedestal-glow {
  background: rgba(5, 150, 105, 0.2);
}

/* Machine Image Container & Responsive Sizing */
.machine-img-wrapper {
  position: relative;
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2;
}

.machine-img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
  max-height: 400px;
  transition: filter 0.4s ease, transform 0.4s ease;
  user-select: none;
  -webkit-user-drag: none;
}

/* Machine State Image Glows & Micro-vibration */
.state-off .machine-img {
  filter: drop-shadow(0 20px 25px rgba(15, 23, 42, 0.16)) drop-shadow(0 0 15px rgba(220, 38, 38, 0.15));
}

.state-idle .machine-img {
  filter: drop-shadow(0 22px 30px rgba(15, 23, 42, 0.18)) drop-shadow(0 0 25px rgba(217, 119, 6, 0.2));
}

.state-load .machine-img {
  filter: drop-shadow(0 25px 35px rgba(15, 23, 42, 0.2)) drop-shadow(0 0 30px rgba(5, 150, 105, 0.25));
  animation: machineVibration 0.12s linear infinite;
}

@keyframes machineVibration {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-0.6px, 0.4px); }
  50% { transform: translate(0.5px, -0.5px); }
  75% { transform: translate(-0.4px, -0.4px); }
  100% { transform: translate(0, 0); }
}

/* Operational Facility Description Banner */
.machine-operational-banner {
  background: var(--bg-subtle);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 12px;
}

.operational-desc-text {
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 10px;
}

.operational-desc-text strong {
  color: var(--text-main);
}

/* ==============================================================================
   RESPONSIVE DESIGN SYSTEM (DESKTOP, TABLET & MOBILE PHONES)
   ============================================================================== */

/* Large Tablets & Small Laptops (<= 1100px) */
@media (max-width: 1100px) {
  .cards-grid, .trend-kpi-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Standard Tablets & Large Phones (<= 860px) */
@media (max-width: 860px) {
  .header-top {
    height: auto;
    padding: 14px 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }

  .header-controls {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
  }

  .scada-nav-tabs {
    overflow-x: auto;
    width: 100%;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 6px;
  }

  .nav-tab-btn {
    white-space: nowrap;
    padding: 8px 12px;
    font-size: 12px;
  }
}

/* Mobile Phones (<= 768px) */
@media (max-width: 768px) {
  .scada-header {
    padding: 0 16px;
  }

  .header-top {
    padding: 12px 0 10px;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .station-title h1 {
    font-size: 15px;
  }

  .station-brand-logo {
    height: 24px;
    max-width: 80px;
  }

  .station-brand-divider {
    height: 22px;
  }

  .station-brand-logo-wrap {
    padding: 3px 8px;
    border-radius: 8px;
  }

  .station-logo {
    width: 36px;
    height: 36px;
    font-size: 15px;
    border-radius: 10px;
  }

  .scada-clock {
    display: none;
  }

  .user-badge {
    padding: 2px 8px 2px 4px;
  }

  .user-avatar {
    width: 26px;
    height: 26px;
    font-size: 11px;
  }

  /* Main Workspace Mobile Spacing */
  main.scada-main {
    padding: 14px 12px 80px 12px;
    gap: 16px;
  }

  .panel {
    padding: 16px;
    border-radius: 16px;
  }

  .machine-mimic-card {
    padding: 16px 14px;
    border-radius: 18px;
    gap: 16px;
  }

  .machine-header-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .machine-stage {
    min-height: 260px;
    padding: 20px 8px 16px;
  }

  .machine-img {
    max-height: 240px;
  }

  /* Phase Cards 2x2 on Mobile Phones */
  .cards-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .phase-card {
    padding: 14px;
    border-radius: 14px;
  }

  .reading-val {
    font-size: 28px;
    margin-top: 8px;
  }

  .reading-val span {
    font-size: 13px;
  }

  /* Status Panel on Mobile */
  .status-panel {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    padding: 18px 16px;
  }

  .status-display {
    font-size: 26px;
  }

  /* Trends Mobile */
  .trend-canvas-wrap {
    height: 260px;
    padding: 8px;
  }

  .trend-kpi-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .time-btn-group {
    overflow-x: auto;
    width: 100%;
  }

  /* Reports Mobile */
  .reports-toolbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    padding: 14px;
  }

  .filter-group {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .filter-group > div {
    width: 100%;
  }

  .btn-export {
    width: 100%;
    justify-content: center;
  }

  /* Mobile Sticky Bottom Navigation */
  .mobile-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--panel-border);
    z-index: 999;
    padding: 6px 8px;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -4px 20px rgba(15, 23, 42, 0.08);
  }

  .mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    background: transparent;
    border: 0;
    color: var(--text-dim);
    font-size: 10px;
    font-weight: 700;
    padding: 6px 10px;
    border-radius: 10px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
    min-width: 58px;
    position: relative;
  }

  .mobile-nav-item .nav-icon {
    font-size: 18px;
    line-height: 1;
  }

  .mobile-nav-item.active {
    color: #0284c7;
    background: #e0f2fe;
  }

  /* Login Gateway on Mobile */
  .login-card {
    padding: 28px 20px;
    border-radius: 22px;
  }
}

/* Small Smart Phones (<= 420px) */
@media (max-width: 420px) {
  .cards-grid {
    grid-template-columns: 1fr;
  }
  .reading-val {
    font-size: 32px;
  }
  .station-title h1 {
    font-size: 13px;
  }
  .station-sub {
    font-size: 10px;
  }
}

/* Admin / Settings form grids */
.admin-form-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  background: var(--bg-subtle);
  padding: 18px;
  border-radius: 14px;
  margin-bottom: 20px;
  border: 1px solid var(--panel-border);
}

.settings-form-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

@media (max-width: 768px) {
  .admin-form-grid, .settings-form-grid {
    grid-template-columns: 1fr;
  }
}

/* ==============================================================================
   WASTE SHREDDER MONITORING SYSTEM - REFERENCE LAYOUT (LIGHT THEME)
   ============================================================================== */
.ws-dashboard {
  max-width: 1720px;
  width: 100%;
  margin: 0 auto;
  padding: 16px 20px 80px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Header Banner */
.ws-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: #ffffff;
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  box-shadow: var(--shadow-scada);
}

.ws-brand-title {
  display: flex;
  align-items: center;
  gap: 14px;
}

.ws-brand-logo {
  height: 34px;
  width: auto;
  display: flex;
  align-items: center;
}

.ws-brand-text {
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 1px;
  color: var(--text-main);
  text-transform: uppercase;
}

.ws-header-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.ws-datetime-badge {
  font-family: 'Outfit', monospace;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.ws-online-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.5px;
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
}

.ws-online-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 10px #10b981;
}

/* Top Telemetry Strip (7 Cards) */
.ws-top-strip {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 14px;
}

.ws-card {
  background: #ffffff;
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  position: relative;
  overflow: hidden;
}

.ws-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
  border-color: var(--panel-border-bright);
}

.ws-card-label {
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-dim);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ws-status-block {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 2px;
}

.ws-status-light {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  position: relative;
  flex-shrink: 0;
  box-shadow: 0 0 16px currentColor;
}

.ws-status-light.state-load {
  background: #10b981;
  color: #10b981;
}
.ws-status-light.state-idle {
  background: #f59e0b;
  color: #f59e0b;
}
.ws-status-light.state-off {
  background: #ef4444;
  color: #ef4444;
}

.ws-status-headline {
  font-size: 17px;
  font-weight: 900;
  letter-spacing: 0.5px;
  line-height: 1.2;
}

.ws-status-sub {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  margin-top: 1px;
}

.ws-metric-val {
  font-size: 26px;
  font-weight: 900;
  color: var(--text-main);
  font-variant-numeric: tabular-nums;
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-top: 2px;
}

.ws-metric-unit {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 700;
}

/* Operating State Pill with Signal Bars */
.ws-op-badge-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 4px;
}

.ws-op-pill {
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.ws-op-pill.state-load {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.ws-op-pill.state-idle {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
}

.ws-op-pill.state-off {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.ws-signal-bars {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 22px;
}

.ws-signal-bar {
  width: 4px;
  border-radius: 2px;
  background: #e2e8f0;
  transition: height 0.3s ease, background-color 0.3s ease;
}

/* Center Hero Grid (Phase Gauges - Machine Stage - Load Classification) */
.ws-center-grid {
  display: grid;
  grid-template-columns: 310px 1fr 310px;
  gap: 16px;
  align-items: stretch;
}

/* Phase Current Panel */
.ws-phase-panel {
  background: #ffffff;
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ws-panel-header {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-main);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--panel-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ws-phase-gauges-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  flex: 1;
  align-items: center;
}

.ws-phase-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.ws-phase-tag-pill {
  width: 100%;
  padding: 4px 6px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 900;
  text-align: center;
  color: #fff;
  letter-spacing: 0.5px;
}

.ws-phase-tag-pill.r-phase { background: #e11d48; }
.ws-phase-tag-pill.y-phase { background: #d97706; }
.ws-phase-tag-pill.b-phase { background: #2563eb; }

/* Center Hero Machine Mimic */
.ws-machine-hero {
  background: #ffffff;
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  padding: 16px 20px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.ws-machine-stage {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 250px;
  background: radial-gradient(ellipse at 50% 65%, #ffffff 0%, #f8fafc 55%, #f1f5f9 100%);
  border-radius: 12px;
  border: 1px solid var(--panel-border);
  overflow: hidden;
}

.ws-stage-floor {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 100px;
  background-image: 
    linear-gradient(rgba(2, 132, 199, 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(2, 132, 199, 0.12) 1px, transparent 1px);
  background-size: 24px 24px;
  transform: perspective(350px) rotateX(60deg);
  transform-origin: bottom center;
  pointer-events: none;
}

.ws-machine-img {
  width: 100%;
  max-width: 460px;
  height: auto;
  max-height: 230px;
  object-fit: contain;
  z-index: 2;
  transition: transform 0.3s ease, filter 0.3s ease;
  user-select: none;
}

.state-load .ws-machine-img {
  filter: drop-shadow(0 16px 24px rgba(15, 23, 42, 0.2)) drop-shadow(0 0 25px rgba(5, 150, 105, 0.25));
  animation: machineVibration 0.12s linear infinite;
}

.state-idle .ws-machine-img {
  filter: drop-shadow(0 14px 20px rgba(15, 23, 42, 0.18)) drop-shadow(0 0 20px rgba(217, 119, 6, 0.2));
}

.state-off .ws-machine-img {
  filter: drop-shadow(0 12px 18px rgba(15, 23, 42, 0.15)) drop-shadow(0 0 15px rgba(220, 38, 38, 0.15));
}

/* Right Load Classification Panel */
.ws-load-class-panel {
  background: #ffffff;
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Segmented Progress Bar */
.ws-load-bar-wrap {
  margin-top: 4px;
}

.ws-load-bar {
  display: flex;
  height: 12px;
  border-radius: 6px;
  overflow: hidden;
  gap: 2px;
  background: #f1f5f9;
  border: 1px solid var(--panel-border);
}

.ws-bar-seg {
  height: 100%;
  transition: opacity 0.2s;
}

.ws-bar-seg.seg-off { width: 5%; background: #94a3b8; }
.ws-bar-seg.seg-idle { width: 15%; background: #eab308; }
.ws-bar-seg.seg-normal { width: 50%; background: #22c55e; }
.ws-bar-seg.seg-high { width: 20%; background: #f97316; }
.ws-bar-seg.seg-over { width: 10%; background: #ef4444; }

.ws-bar-ticks {
  display: flex;
  justify-content: space-between;
  font-size: 9.5px;
  color: var(--text-dim);
  font-weight: 700;
  margin-top: 4px;
}

/* Classification Table */
.ws-class-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  margin-top: 4px;
}

.ws-class-row {
  border-bottom: 1px solid #f1f5f9;
  transition: background 0.15s ease;
}

.ws-class-row.active {
  background: #f8fafc;
  border-left: 3px solid #0284c7;
}

.ws-class-row td {
  padding: 6px 8px;
  font-weight: 700;
}

.ws-class-range {
  color: var(--text-muted);
  width: 45%;
}

.ws-class-tag {
  text-align: right;
  font-weight: 800;
}

.ws-class-tag.tag-off { color: #64748b; }
.ws-class-tag.tag-idle { color: #d97706; }
.ws-class-tag.tag-normal { color: #059669; }
.ws-class-tag.tag-high { color: #ea580c; }
.ws-class-tag.tag-over { color: #dc2626; }

/* Middle Grid: Current Trend (1h) & Load Profile (Today) */
.ws-middle-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 16px;
}

.ws-trend-card {
  background: #ffffff;
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  padding: 16px 20px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
  display: flex;
  flex-direction: column;
}

.ws-trend-canvas-wrap {
  width: 100%;
  height: 220px;
  position: relative;
  margin-top: 10px;
}

.ws-profile-card {
  background: #ffffff;
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
  display: flex;
  flex-direction: column;
}

.ws-profile-content {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 14px;
  align-items: center;
  flex: 1;
  margin-top: 8px;
}

.ws-donut-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ws-donut-center-text {
  position: absolute;
  text-align: center;
  pointer-events: none;
}

.ws-donut-center-sub {
  font-size: 9px;
  color: var(--text-dim);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ws-donut-center-val {
  font-size: 13px;
  font-weight: 900;
  color: var(--text-main);
  margin-top: 2px;
}

.ws-profile-table {
  width: 100%;
  font-size: 11px;
}

.ws-profile-table tr td {
  padding: 4px 6px;
}

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

/* Bottom Grid: 4 Statistics Cards */
.ws-bottom-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.ws-stat-card {
  background: #ffffff;
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
  display: flex;
  gap: 14px;
  align-items: center;
  transition: transform 0.2s, box-shadow 0.2s;
}

.ws-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

.ws-stat-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 22px;
  flex-shrink: 0;
}

.ws-stat-icon-wrap.clock { background: #ecfdf5; color: #059669; }
.ws-stat-icon-wrap.play { background: #eff6ff; color: #2563eb; }
.ws-stat-icon-wrap.warn { background: #fffbeb; color: #d97706; }
.ws-stat-icon-wrap.wave { background: #f5f3ff; color: #7c3aed; }

.ws-stat-info {
  flex: 1;
}

.ws-stat-title {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.ws-stat-rows {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 12px;
}

.ws-stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-variant-numeric: tabular-nums;
}

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

.ws-stat-row .val {
  font-weight: 800;
  color: var(--text-main);
}

/* Responsive Adaptations */
@media (max-width: 1400px) {
  .ws-top-strip {
    grid-template-columns: repeat(4, 1fr);
  }
  .ws-center-grid {
    grid-template-columns: 280px 1fr 280px;
  }
  .ws-middle-grid {
    grid-template-columns: 1fr 340px;
  }
}

@media (max-width: 1100px) {
  .ws-center-grid {
    grid-template-columns: 1fr 1fr;
  }
  .ws-center-grid .ws-machine-hero {
    grid-column: 1 / -1;
    order: -1;
  }
  .ws-middle-grid {
    grid-template-columns: 1fr;
  }
  .ws-bottom-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .scada-header {
    padding: 0 16px;
  }
  .header-top {
    height: auto;
    padding: 12px 0 8px 0;
    flex-wrap: wrap;
    gap: 12px;
  }
  .header-controls {
    width: 100%;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
  }
  .scada-nav-tabs {
    display: none !important; /* Hide horizontal desktop tabs on mobile */
  }
  .scada-mobile-nav {
    display: block !important; /* Show dropdown menu on mobile */
  }
  main.scada-main {
    padding: 16px 12px;
  }
  .ws-top-strip {
    grid-template-columns: repeat(2, 1fr);
  }
  .ws-center-grid {
    grid-template-columns: 1fr;
  }
  .ws-bottom-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .station-title h1 {
    font-size: 14px;
  }
  .station-brand-logo {
    height: 20px;
    max-width: 65px;
  }
  .station-brand-logo-wrap {
    padding: 2px 6px;
    border-radius: 6px;
  }
  .station-brand-divider {
    display: none;
  }
  .station-logo {
    width: 38px;
    height: 38px;
    font-size: 16px;
  }
  .ws-top-strip {
    grid-template-columns: 1fr;
  }
  .ws-phase-gauges-row {
    flex-direction: column;
    gap: 12px;
  }
  .perm-grid {
    grid-template-columns: 1fr;
  }
}

/* ==============================================================================
   USER CONFIGURATION & MODALS (OPTIONS A & C)
   ============================================================================== */
.scada-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeInModal 0.2s ease;
}

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

.scada-modal-card {
  background: #ffffff;
  border: 1px solid var(--panel-border);
  border-radius: 20px;
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.25);
  animation: scaleInModal 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}

@keyframes scaleInModal {
  from { transform: scale(0.94) translateY(10px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}

.scada-modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--panel-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8fafc;
}

.scada-modal-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.scada-modal-close {
  background: transparent;
  border: none;
  font-size: 20px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
}
.scada-modal-close:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.scada-modal-body {
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.scada-modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--panel-border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  background: #f8fafc;
}

/* User Status Badges */
.status-pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}
.status-pill-badge.active {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
}
.status-pill-badge.inactive {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

/* Permission Matrix Pills */
.perm-matrix-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.perm-pill {
  font-size: 10px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 6px;
  letter-spacing: 0.3px;
}
.perm-pill.granted {
  background: #e0f2fe;
  color: #0284c7;
  border: 1px solid #bae6fd;
}
.perm-pill.denied {
  background: #f1f5f9;
  color: #94a3b8;
  border: 1px solid #e2e8f0;
  opacity: 0.7;
  text-decoration: line-through;
}

/* Granular Permission Checkboxes Grid */
.perm-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 6px;
}

.perm-checkbox-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: #f8fafc;
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.perm-checkbox-card:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.perm-checkbox-card input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  accent-color: #0284c7;
  cursor: pointer;
}

.perm-card-text {
  display: flex;
  flex-direction: column;
}

.perm-card-title {
  font-size: 12px;
  font-weight: 800;
  color: var(--text-main);
}

.perm-card-desc {
  font-size: 10.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Action Buttons in Table */
.btn-action-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.btn-action-sm {
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
  border: 1px solid transparent;
  transition: all 0.15s ease;
}

.btn-action-edit {
  background: #f0fdf4;
  color: #15803d;
  border-color: #bbf7d0;
}
.btn-action-edit:hover { background: #dcfce7; }

.btn-action-reset {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}
.btn-action-reset:hover { background: #dbeafe; }

.btn-action-delete {
  background: #fef2f2;
  color: #b91c1c;
  border-color: #fecaca;
}
.btn-action-delete:hover { background: #fee2e2; }


