@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --sidebar-bg: #0d1b2a;
  --sidebar-hover: #1b2d44;
  --sidebar-active: #0a3d62;
  --header-bg: #0d2137;
  --bg-primary: #f0f2f5;
  --bg-card: #ffffff;
  --bg-input: #f8f9fa;
  --text-primary: #0d1b2a;
  --text-secondary: #4a5568;
  --text-muted: #8896a6;
  --text-light: #cbd5e0;
  --accent: #0057a8;
  --accent-hover: #004a8f;
  --accent-light: rgba(0, 87, 168, 0.10);
  --success: #27ae60;
  --warning: #f39c12;
  --danger: #e74c3c;
  --border: #e2e8f0;
  --shadow: 0 2px 8px rgba(13,27,42,0.06);
  --shadow-lg: 0 8px 30px rgba(13,27,42,0.12);
  --radius: 10px;
  --radius-sm: 6px;
  --transition: 0.2s ease;
  --uc-navy: #0d1b2a;
  --uc-navy-light: #1b3a5c;
  --uc-blue: #0057a8;
  --uc-blue-glow: rgba(0, 87, 168, 0.35);
  --uc-green: #39b54a;
  --uc-green-glow: rgba(57, 181, 74, 0.35);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  display: flex;
  min-height: 100vh;
  overflow: hidden;
}

/* ══════════════════════════════════════════════════════
   LOGIN — PREMIUM WEB3 AESTHETIC
   ══════════════════════════════════════════════════════ */
.login-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: #040b14;
  z-index: 10000;
  overflow: hidden;
}

.login-bg {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  overflow: hidden;
}

.mesh-gradient {
  position: absolute;
  top: -50%; left: -50%;
  width: 200%; height: 200%;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(0, 87, 168, 0.20) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(57, 181, 74, 0.12) 0%, transparent 50%),
    radial-gradient(ellipse at 60% 80%, rgba(13, 27, 42, 0.4) 0%, transparent 50%),
    radial-gradient(ellipse at 40% 30%, rgba(0, 87, 168, 0.10) 0%, transparent 40%);
  animation: meshMove 20s ease-in-out infinite;
}

@keyframes meshMove {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  25% { transform: translate(2%, -3%) rotate(1deg); }
  50% { transform: translate(-1%, 2%) rotate(-0.5deg); }
  75% { transform: translate(3%, 1%) rotate(0.5deg); }
}

.grid-lines {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image:
    linear-gradient(rgba(21, 101, 192, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(21, 101, 192, 0.04) 1px, transparent 1px);
  background-size: 60px 60px;
  animation: gridPulse 8s ease-in-out infinite;
}

@keyframes gridPulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.6; }
}

.particles {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
}

.particles span {
  position: absolute;
  width: 4px; height: 4px;
  background: var(--uc-green);
  border-radius: 50%;
  animation: particleFloat linear infinite;
  box-shadow: 0 0 6px var(--uc-green-glow);
}

.particles span:nth-child(1) { left: 10%; top: 20%; animation-duration: 18s; animation-delay: 0s; width: 3px; height: 3px; }
.particles span:nth-child(2) { left: 25%; top: 70%; animation-duration: 22s; animation-delay: -3s; width: 5px; height: 5px; background: rgba(0,87,168,0.6); box-shadow: 0 0 6px rgba(0,87,168,0.3); }
.particles span:nth-child(3) { left: 45%; top: 40%; animation-duration: 16s; animation-delay: -5s; background: rgba(0,87,168,0.6); box-shadow: 0 0 6px rgba(0,87,168,0.3); }
.particles span:nth-child(4) { left: 65%; top: 15%; animation-duration: 24s; animation-delay: -8s; width: 3px; height: 3px; }
.particles span:nth-child(5) { left: 80%; top: 60%; animation-duration: 20s; animation-delay: -2s; width: 6px; height: 6px; background: rgba(0,87,168,0.5); box-shadow: 0 0 8px rgba(0,87,168,0.25); }
.particles span:nth-child(6) { left: 35%; top: 85%; animation-duration: 19s; animation-delay: -7s; }
.particles span:nth-child(7) { left: 55%; top: 10%; animation-duration: 21s; animation-delay: -4s; width: 2px; height: 2px; background: rgba(0,87,168,0.5); box-shadow: 0 0 6px rgba(0,87,168,0.25); }
.particles span:nth-child(8) { left: 90%; top: 45%; animation-duration: 17s; animation-delay: -6s; background: rgba(0,87,168,0.4); box-shadow: 0 0 6px rgba(0,87,168,0.2); }
.particles span:nth-child(9) { left: 15%; top: 50%; animation-duration: 23s; animation-delay: -1s; width: 4px; height: 4px; }
.particles span:nth-child(10) { left: 72%; top: 80%; animation-duration: 15s; animation-delay: -9s; width: 3px; height: 3px; background: rgba(0,87,168,0.5); box-shadow: 0 0 6px rgba(0,87,168,0.25); }
.particles span:nth-child(11) { left: 5%; top: 90%; animation-duration: 25s; animation-delay: -3s; width: 5px; height: 5px; }
.particles span:nth-child(12) { left: 50%; top: 55%; animation-duration: 26s; animation-delay: -11s; width: 2px; height: 2px; background: rgba(0,87,168,0.5); }

@keyframes particleFloat {
  0% { transform: translateY(0) translateX(0) scale(1); opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { transform: translateY(-100vh) translateX(40px) scale(0.5); opacity: 0; }
}

.login-container {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 40px;
  gap: 80px;
}

.login-hero {
  max-width: 480px;
  color: #fff;
  animation: heroFadeIn 1s ease 0.2s both;
}

@keyframes heroFadeIn {
  from { opacity: 0; transform: translateX(-30px); }
  to { opacity: 1; transform: translateX(0); }
}

.hero-logo {
  width: 180px;
  height: auto;
  margin-bottom: 20px;
  filter: drop-shadow(0 4px 20px rgba(0,0,0,0.4));
  border-radius: 8px;
}

.login-hero h1 {
  font-size: 42px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
}

.login-hero h1 span {
  background: linear-gradient(135deg, var(--uc-green), #2ecc71);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-tagline {
  font-size: 15px;
  color: rgba(255,255,255,0.55);
  margin-bottom: 36px;
  line-height: 1.5;
  font-weight: 400;
}

.hero-features {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.hero-feature {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  transition: all 0.3s ease;
  backdrop-filter: blur(4px);
}

.hero-feature:hover {
  background: rgba(57, 181, 74, 0.08);
  border-color: rgba(57, 181, 74, 0.2);
  transform: translateX(6px);
}

.hero-feature i {
  font-size: 18px;
  color: var(--uc-green);
  width: 24px;
  text-align: center;
}

.hero-feature span {
  font-size: 14px;
  font-weight: 500;
  color: rgba(255,255,255,0.8);
}

.hero-products {
  display: flex;
  gap: 10px;
  margin-top: 32px;
  flex-wrap: wrap;
}

.hero-product-badge {
  padding: 6px 14px;
  background: rgba(0, 87, 168, 0.15);
  border: 1px solid rgba(0, 87, 168, 0.25);
  border-radius: 20px;
  font-size: 11px;
  color: rgba(255,255,255,0.7);
  font-weight: 500;
  letter-spacing: 0.3px;
}

.login-card {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 20px;
  padding: 44px 40px;
  width: 420px;
  max-width: 90vw;
  box-shadow: 0 30px 80px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  animation: cardFadeIn 1s ease 0.5s both;
}

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

.login-logo {
  text-align: center;
  margin-bottom: 28px;
}

.login-logo .logo-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--uc-green), #2ecc71);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
  font-size: 22px;
  color: #fff;
  box-shadow: 0 4px 20px var(--uc-green-glow);
}

.login-logo h1 {
  font-size: 22px;
  font-weight: 700;
  color: #e2e8f0;
  letter-spacing: 0.3px;
}

.login-logo p {
  font-size: 13px;
  color: rgba(255,255,255,0.4);
  margin-top: 6px;
}

.login-form .form-group {
  margin-bottom: 18px;
}

.login-form .form-group label {
  color: rgba(255,255,255,0.5);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 6px;
  display: block;
}

.login-form .form-group input {
  width: 100%;
  padding: 13px 16px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  color: #e2e8f0;
  font-size: 14px;
  font-family: inherit;
  transition: all 0.25s ease;
}

.login-form .form-group input:focus {
  outline: none;
  border-color: var(--uc-blue);
  box-shadow: 0 0 0 3px var(--uc-blue-glow), 0 0 20px rgba(0, 87, 168, 0.1);
  background: rgba(255,255,255,0.06);
}

.login-form .form-group input::placeholder { color: rgba(255,255,255,0.2); }

.btn-block {
  width: 100%;
  padding: 13px;
  font-size: 14px;
  justify-content: center;
}

.btn-login {
  background: linear-gradient(135deg, var(--uc-green), #2ecc71);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-weight: 700;
  letter-spacing: 0.3px;
  box-shadow: 0 4px 20px var(--uc-green-glow);
  transition: all 0.3s ease;
}

.btn-login:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px var(--uc-green-glow);
}

.login-links {
  display: flex;
  justify-content: center;
  margin-top: 16px;
}

.login-links a {
  font-size: 12px;
  color: rgba(255,255,255,0.4);
  text-decoration: none;
  transition: color 0.2s;
  font-weight: 500;
}

.login-links a:hover { color: var(--uc-green); }

.login-error {
  color: #f87171;
  font-size: 13px;
  text-align: center;
  margin-top: 10px;
  padding: 10px;
  background: rgba(248, 113, 113, 0.1);
  border-radius: 8px;
  border: 1px solid rgba(248, 113, 113, 0.15);
}

.login-footer {
  text-align: center;
  font-size: 11px;
  color: rgba(255,255,255,0.2);
  margin-top: 28px;
  line-height: 1.5;
}

.login-footer a { color: rgba(255,255,255,0.35); text-decoration: none; }
.login-footer a:hover { color: var(--uc-green); }

/* ── Forgot Password Modal ────────────────────────── */
.forgot-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(4, 11, 20, 0.85);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  z-index: 10001;
}

.forgot-card {
  background: rgba(13, 27, 42, 0.95);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px;
  padding: 36px;
  width: 420px;
  max-width: 90vw;
  backdrop-filter: blur(20px);
  box-shadow: 0 30px 60px rgba(0,0,0,0.5);
}

.forgot-card h2 {
  color: #e2e8f0;
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
}

.forgot-card p {
  color: rgba(255,255,255,0.4);
  font-size: 13px;
  margin-bottom: 20px;
  line-height: 1.5;
}

/* ══════════════════════════════════════════════════════
   SIDEBAR
   ══════════════════════════════════════════════════════ */
.sidebar {
  width: 260px;
  min-width: 260px;
  background: var(--sidebar-bg);
  color: #fff;
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 100;
}

.sidebar-brand {
  padding: 18px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-brand-logo {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: contain;
  flex-shrink: 0;
}

.sidebar-brand-text h1 {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.3px;
  line-height: 1.3;
}

.sidebar-brand-text h1 span { color: var(--uc-green); }

.sidebar-brand-text p {
  font-size: 10px;
  color: rgba(255,255,255,0.4);
  margin-top: 2px;
}

.sidebar-user {
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--uc-blue), #0070d4);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.user-info { display: flex; flex-direction: column; min-width: 0; }
.user-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 10px; color: rgba(255,255,255,0.4); text-transform: uppercase; letter-spacing: 0.5px; }

.sidebar-nav { flex: 1; padding: 12px 0; overflow-y: auto; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 20px;
  color: rgba(255,255,255,0.55);
  cursor: pointer;
  transition: all var(--transition);
  font-size: 13px;
  font-weight: 500;
  border-left: 3px solid transparent;
}

.nav-item:hover { background: var(--sidebar-hover); color: rgba(255,255,255,0.9); }

.nav-item.active {
  background: var(--sidebar-active);
  color: #fff;
  border-left-color: var(--uc-green);
}

.nav-item i { width: 20px; text-align: center; font-size: 14px; }

.nav-section {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 1.8px;
  color: rgba(255,255,255,0.25);
  padding: 16px 20px 6px;
  font-weight: 700;
}

.sidebar-footer {
  padding: 14px 20px;
  border-top: 1px solid rgba(255,255,255,0.06);
  font-size: 10px;
  color: rgba(255,255,255,0.25);
  text-align: center;
}

.btn-logout {
  color: rgba(255,255,255,0.45) !important;
  border-color: rgba(255,255,255,0.1) !important;
  font-size: 11px !important;
  padding: 6px 12px !important;
}

.btn-logout:hover {
  background: rgba(255,255,255,0.06) !important;
  color: #fff !important;
}

/* ══════════════════════════════════════════════════════
   MAIN CONTENT
   ══════════════════════════════════════════════════════ */
.main-content {
  flex: 1;
  margin-left: 260px;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.top-bar {
  background: var(--bg-card);
  padding: 14px 28px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}

.top-bar-left { display: flex; align-items: center; gap: 0; }
.top-bar h2 { font-size: 18px; font-weight: 700; color: var(--text-primary); }

.top-bar .badge {
  background: linear-gradient(135deg, var(--uc-navy), var(--uc-navy-light));
  color: #fff;
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.content-area { flex: 1; padding: 24px 28px; overflow-y: auto; }

.tab-content { display: none; animation: fadeIn 0.3s ease; }
.tab-content.active { display: block; }

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

/* ══════════════════════════════════════════════════════
   SECTION CARDS
   ══════════════════════════════════════════════════════ */
.section-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.section-card-header {
  background: linear-gradient(135deg, var(--header-bg), var(--uc-navy-light));
  color: #fff;
  padding: 12px 18px;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: 0.2px;
}

.section-card-header i { opacity: 0.7; font-size: 13px; }
.section-card-body { padding: 18px; }

.qr-section-check {
  display: flex; align-items: center; gap: 8px; padding: 8px 12px;
  border-radius: 8px; border: 1px solid var(--glass-border); cursor: pointer;
  font-size: 13px; transition: all 0.2s;
}
.qr-section-check:hover { background: rgba(255,255,255,0.04); }
.qr-section-check input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--uc-green); cursor: pointer; }

/* ══════════════════════════════════════════════════════
   FORMS
   ══════════════════════════════════════════════════════ */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.form-group { display: flex; flex-direction: column; gap: 4px; }

.form-group label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-group input,
.form-group select {
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: 'JetBrains Mono', monospace;
  background: var(--bg-input);
  color: var(--text-primary);
  transition: border-color var(--transition), box-shadow var(--transition);
}

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

.form-group select { cursor: pointer; }
.form-group .unit { font-size: 10px; color: var(--text-muted); margin-top: 2px; }

.form-row { display: flex; gap: 12px; align-items: flex-end; }
.form-row .form-group { flex: 1; }

.checkbox-group { display: flex; align-items: center; gap: 8px; padding: 8px 0; }
.checkbox-group input[type="checkbox"] { width: 18px; height: 18px; cursor: pointer; accent-color: var(--accent); }
.checkbox-group label { font-size: 13px; font-weight: 500; cursor: pointer; }

/* ══════════════════════════════════════════════════════
   BUTTONS
   ══════════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
}

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); box-shadow: 0 4px 12px var(--uc-blue-glow); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #219a52; }

.btn-outline { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
.btn-outline:hover { background: var(--accent); color: #fff; }

.btn-sm { padding: 6px 14px; font-size: 12px; }

.btn-icon {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border: none; border-radius: var(--radius-sm);
  cursor: pointer; transition: all var(--transition); background: transparent;
}

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

.btn-generate {
  background: linear-gradient(135deg, var(--uc-green), #2ecc71);
  color: #fff;
  padding: 14px 32px;
  font-size: 15px;
  font-weight: 700;
  border-radius: var(--radius);
  box-shadow: 0 4px 20px var(--uc-green-glow);
  letter-spacing: 0.3px;
}

.btn-generate:hover { transform: translateY(-2px); box-shadow: 0 8px 30px var(--uc-green-glow); }
.btn-generate:disabled { opacity: 0.6; transform: none; box-shadow: none; }

.generate-section { text-align: center; padding: 24px; margin-top: 8px; }

/* ══════════════════════════════════════════════════════
   CONDUCTOR INVENTORY
   ══════════════════════════════════════════════════════ */
.conductor-form {
  display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap;
  padding-bottom: 16px; border-bottom: 1px solid var(--border); margin-bottom: 16px;
}

.conductor-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; background: var(--bg-input);
  border-radius: var(--radius-sm); margin-bottom: 6px;
  transition: background var(--transition);
}

.conductor-item:hover { background: rgba(0, 87, 168, 0.06); }
.conductor-info { display: flex; align-items: center; gap: 10px; }

.conductor-icon {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent); color: #fff; border-radius: 8px; font-size: 12px;
}

.conductor-label { font-weight: 600; font-size: 13px; }
.conductor-area { color: var(--text-muted); font-size: 12px; font-family: 'JetBrains Mono', monospace; }

/* ══════════════════════════════════════════════════════
   EMPTY STATE
   ══════════════════════════════════════════════════════ */
.empty-state { text-align: center; padding: 32px; color: var(--text-muted); }
.empty-state i { font-size: 36px; margin-bottom: 10px; display: block; }
.empty-state.large i { font-size: 48px; }
.empty-state h3 { margin: 8px 0; color: var(--text-secondary); }

/* ══════════════════════════════════════════════════════
   DESIGN CARDS
   ══════════════════════════════════════════════════════ */
.design-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px; margin-top: 18px;
}

.design-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden; cursor: pointer;
  transition: all var(--transition);
  border: 2px solid transparent;
}

.design-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent);
}

.card-header {
  padding: 12px 16px;
  background: linear-gradient(135deg, var(--header-bg), var(--uc-navy-light));
  color: #fff;
  display: flex; align-items: center; justify-content: space-between;
}

.card-number { font-size: 20px; font-weight: 700; display: flex; align-items: center; gap: 10px; }

.card-tags { display: flex; gap: 4px; flex-wrap: wrap; }

.design-tag {
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.tag-cost { background: #d4edda; color: #155724; }
.tag-weight { background: #cce5ff; color: #004085; }
.tag-efficiency { background: #fff3cd; color: #856404; }
.tag-balanced { background: #e2e3e5; color: #383d41; }

.card-body {
  padding: 14px 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.card-metric {
  display: flex; justify-content: space-between; align-items: center;
  padding: 4px 0; border-bottom: 1px solid #f0f0f0;
}

.metric-label { font-size: 11px; color: var(--text-muted); }
.metric-value { font-size: 13px; font-weight: 600; font-family: 'JetBrains Mono', monospace; }

.card-footer {
  padding: 10px 16px;
  background: #fafafa;
  display: flex; gap: 8px; justify-content: flex-end;
  border-top: 1px solid var(--border);
}

.card-radar {
  display: flex; justify-content: center; align-items: center;
  padding: 8px 16px 4px;
  border-top: 1px solid var(--border);
}
.card-radar canvas { max-width: 180px; max-height: 180px; }

.compare-radar-container {
  max-width: 600px;
  margin: 24px auto 0;
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.card-warnings { padding: 6px 16px; background: #fff3cd; color: #856404; font-size: 11px; }

/* ══════════════════════════════════════════════════════
   VALIDATION BADGE
   ══════════════════════════════════════════════════════ */
.validation-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 700;
}

.badge-green { background: #d4edda; color: #155724; }
.badge-lime { background: #e8f5e9; color: #2e7d32; }
.badge-orange { background: #fff3cd; color: #856404; }
.badge-red { background: #f8d7da; color: #721c24; }

.vb-grade { font-size: 13px; }
.vb-score { font-size: 10px; opacity: 0.8; }
.vb-fail-row td { background: #fff5f5 !important; }

/* ══════════════════════════════════════════════════════
   RESULTS
   ══════════════════════════════════════════════════════ */
.results-header { display: flex; align-items: center; justify-content: space-between; }
.results-header h2 { font-size: 18px; }
.results-actions { display: flex; gap: 8px; }

/* ══════════════════════════════════════════════════════
   MODAL
   ══════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(4, 11, 20, 0.6);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; padding: 20px;
}
#saveDesignModal { z-index: 1050; }
#printSelectorModal { z-index: 1050; }
#editConstantModal { z-index: 1050; }

.modal-content {
  background: var(--bg-card);
  border-radius: var(--radius);
  width: 100%; max-width: 900px; max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}

.modal-header {
  position: sticky; top: 0;
  background: linear-gradient(135deg, var(--header-bg), var(--uc-navy-light));
  color: #fff;
  padding: 16px 24px;
  display: flex; align-items: center; justify-content: space-between;
  z-index: 10;
}

.modal-header h2 { font-size: 16px; font-weight: 700; }
.modal-actions { display: flex; gap: 8px; }
.modal-actions .btn { padding: 8px 16px; font-size: 12px; }
.modal-actions .btn-outline { color: #fff; border-color: rgba(255,255,255,0.3); }
.modal-actions .btn-outline:hover { background: rgba(255,255,255,0.12); color: #fff; }
.modal-body { padding: 20px 24px; }

/* ══════════════════════════════════════════════════════
   DETAIL SECTIONS
   ══════════════════════════════════════════════════════ */
.detail-sections { display: flex; flex-direction: column; gap: 16px; }

.detail-section {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.detail-section h3 {
  background: var(--header-bg); color: #fff;
  padding: 8px 14px;
  font-size: 12px; font-weight: 600;
  display: flex; align-items: center; gap: 8px;
}

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

.detail-table td, .detail-table th {
  padding: 6px 14px;
  border-bottom: 1px solid #f0f0f0;
  font-size: 12px;
}

.detail-table td:first-child { width: 45%; font-weight: 500; color: var(--text-secondary); }
.detail-table td:last-child { font-family: 'JetBrains Mono', monospace; font-weight: 600; }
.detail-table tr:hover { background: #f8f9fa; }

.winding-diagram-container { padding: 12px; display: flex; justify-content: center; }
.winding-diagram-container canvas { border: 1px solid var(--border); border-radius: var(--radius-sm); }

.warnings-section { border-color: var(--warning); }
.warnings-section h3 { background: var(--warning); color: #333; }
.warnings-section ul { padding: 10px 14px 10px 30px; font-size: 12px; }
.warnings-section li { margin-bottom: 4px; color: #856404; }

/* ══════════════════════════════════════════════════════
   COMPARISON TABLE
   ══════════════════════════════════════════════════════ */
.comparison-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.table-wrapper { overflow-x: auto; }

.comparison-table {
  width: 100%; border-collapse: collapse; font-size: 12px;
  background: var(--bg-card); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow);
}

.comparison-table th {
  background: var(--header-bg); color: #fff;
  padding: 10px 12px; font-weight: 600; position: sticky; top: 0;
}

.comparison-table td {
  padding: 7px 12px; border-bottom: 1px solid #f0f0f0;
  text-align: center; font-family: 'JetBrains Mono', monospace;
}

.comparison-table td.param-name { text-align: left; font-family: 'Inter', sans-serif; font-weight: 500; }
.comparison-table tr:hover td { background: var(--accent-light); }

/* ══════════════════════════════════════════════════════
   VALIDATION CASES
   ══════════════════════════════════════════════════════ */
.validation-case {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px; margin-bottom: 16px;
  border: 1px solid var(--border);
}

.validation-case h3 { font-size: 15px; margin-bottom: 6px; }
.design-count { font-size: 12px; color: var(--text-muted); margin-bottom: 10px; }
.validation-case table { width: 100%; border-collapse: collapse; }
.validation-case th { background: var(--header-bg); color: #fff; padding: 8px 12px; font-size: 11px; text-align: left; }
.validation-case td { padding: 6px 12px; border-bottom: 1px solid #f0f0f0; font-size: 12px; }
.validation-case tr.pass td { background: #f0fff4; }
.validation-case tr.fail td { background: #fff5f5; }

/* ══════════════════════════════════════════════════════
   PRINT SECTION SELECTOR
   ══════════════════════════════════════════════════════ */
.print-section-list { display: flex; flex-direction: column; gap: 4px; }

.print-check {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; border-radius: var(--radius-sm);
  cursor: pointer; font-size: 13px; font-weight: 500;
  transition: background var(--transition);
}

.print-check:hover { background: var(--bg-input); }
.print-check input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }

/* ══════════════════════════════════════════════════════
   STATUS BADGES
   ══════════════════════════════════════════════════════ */
.status-badge {
  display: inline-block; padding: 3px 10px; border-radius: 20px;
  font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px;
}

.status-draft { background: #e2e3e5; color: #383d41; }
.status-submitted { background: #cce5ff; color: #004085; }
.status-approved { background: #d4edda; color: #155724; }
.status-superseded { background: #fff3cd; color: #856404; }
.status-rejected { background: #f8d7da; color: #721c24; }
.status-archived { background: #f8d7da; color: #721c24; }
.status-active { background: #d4edda; color: #155724; }
.status-inactive { background: #f8d7da; color: #721c24; }

/* ══════════════════════════════════════════════════════
   ACTION BADGE + ADMIN
   ══════════════════════════════════════════════════════ */
.action-badge {
  display: inline-block; padding: 2px 6px;
  background: var(--accent-light); color: var(--uc-navy);
  border-radius: 4px; font-size: 10px; font-weight: 600; text-transform: capitalize;
}

.admin-tabs { display: flex; gap: 4px; margin-bottom: 20px; flex-wrap: wrap; }

.admin-tab {
  padding: 10px 18px; border: 1px solid var(--border); background: var(--bg-card);
  border-radius: var(--radius-sm); font-size: 13px; font-weight: 500;
  cursor: pointer; transition: all var(--transition);
  display: flex; align-items: center; gap: 6px; font-family: inherit; color: var(--text-secondary);
}

.admin-tab:hover { background: var(--accent-light); border-color: var(--accent); }
.admin-tab.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.admin-tab i { font-size: 12px; }

.role-select {
  padding: 4px 8px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 11px; font-family: inherit; background: var(--bg-input); cursor: pointer;
}

/* ══════════════════════════════════════════════════════
   STATS
   ══════════════════════════════════════════════════════ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}

.stat-card {
  background: var(--bg-input); border-radius: var(--radius);
  padding: 24px; text-align: center; border: 1px solid var(--border);
}

.stat-value {
  font-size: 36px; font-weight: 700; color: var(--accent);
  font-family: 'JetBrains Mono', monospace;
}

.stat-label {
  font-size: 12px; color: var(--text-muted); margin-top: 6px;
  text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600;
}

/* ══════════════════════════════════════════════════════
   MISC
   ══════════════════════════════════════════════════════ */
.save-summary {
  background: var(--bg-input); padding: 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); font-size: 13px; line-height: 1.8;
}

.qr-info { font-size: 13px; color: var(--text-secondary); line-height: 1.6; }

#toastContainer {
  position: fixed; bottom: 24px; right: 24px; z-index: 9999;
  display: flex; flex-direction: column; gap: 8px;
}

.toast {
  padding: 12px 20px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500;
  display: flex; align-items: center; gap: 10px;
  box-shadow: var(--shadow-lg);
  transform: translateX(120%); transition: transform 0.3s ease; max-width: 400px;
}

.toast.show { transform: translateX(0); }
.toast-success { background: #d4edda; color: #155724; border-left: 4px solid var(--success); }
.toast-error { background: #f8d7da; color: #721c24; border-left: 4px solid var(--danger); }
.toast-info { background: #d1ecf1; color: #0c5460; border-left: 4px solid var(--uc-blue); }

.lamination-editor { margin-top: 12px; }
.lamination-editor table { width: 100%; border-collapse: collapse; font-size: 12px; }
.lamination-editor th { background: var(--header-bg); color: #fff; padding: 6px 10px; font-weight: 500; }
.lamination-editor td { padding: 4px 6px; border-bottom: 1px solid #eee; }

.lamination-editor input {
  width: 65px; padding: 4px 6px;
  border: 1px solid var(--border); border-radius: 4px;
  font-family: 'JetBrains Mono', monospace; font-size: 11px; text-align: center;
}

.lamination-editor input:focus { outline: none; border-color: var(--accent); }
.pricing-section .form-grid { grid-template-columns: repeat(3, 1fr); }
.hidden { display: none !important; }

/* ══════════════════════════════════════════════════════
   DESIGN ENGINE CONFIG
   ══════════════════════════════════════════════════════ */
.engine-sub-nav {
  display: flex; gap: 4px; margin-bottom: 16px; flex-wrap: wrap;
}
.engine-tab {
  padding: 8px 16px; border: 1px solid var(--border); border-radius: 6px;
  background: var(--card); color: var(--text-secondary); cursor: pointer;
  font-size: 12px; font-weight: 600; transition: all 0.15s;
}
.engine-tab:hover { background: var(--accent-light); color: var(--accent); border-color: var(--accent); }
.engine-tab.active { background: var(--accent); color: #fff; border-color: var(--accent); }

.engine-category-group { margin-bottom: 20px; }
.engine-category-label {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px;
  color: var(--accent); padding: 6px 12px; background: var(--accent-light);
  border-radius: 6px; margin-bottom: 8px; display: inline-block;
}
.engine-constant-row {
  display: grid; grid-template-columns: 1fr 120px 80px; gap: 12px;
  padding: 10px 14px; border: 1px solid var(--border); border-radius: 6px;
  margin-bottom: 6px; background: var(--card); align-items: center;
  transition: border-color 0.15s;
}
.engine-constant-row:hover { border-color: var(--accent); }
.ec-name { font-weight: 600; font-size: 13px; color: var(--text-primary); }
.ec-desc { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.ec-value {
  font-family: 'JetBrains Mono', monospace; font-size: 14px; font-weight: 700;
  color: var(--uc-green, #39b54a); text-align: right;
}
.ec-unit { font-size: 10px; color: var(--text-muted); font-weight: 400; }

.formula-accordion { margin-bottom: 10px; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.formula-header {
  padding: 12px 16px; cursor: pointer; display: flex; align-items: center; gap: 10px;
  background: var(--card); font-weight: 600; font-size: 13px; transition: background 0.15s;
}
.formula-header:hover { background: var(--accent-light); }
.formula-header .formula-toggle { margin-left: auto; color: var(--text-muted); transition: transform 0.2s; }
.formula-header.open .formula-toggle { transform: rotate(180deg); }
.formula-body {
  display: none; padding: 16px; background: #f9fafb; border-top: 1px solid var(--border);
}
.formula-body.open { display: block; }
.formula-math {
  padding: 14px 18px; background: #fff; border: 1px solid #e2e8f0; border-radius: 6px;
  margin-bottom: 12px; overflow-x: auto; text-align: center;
}
.formula-pseudocode {
  background: #1a1f2e; color: #a8d8a8; padding: 12px 16px; border-radius: 6px;
  font-family: 'JetBrains Mono', monospace; font-size: 11px; line-height: 1.6;
  white-space: pre-wrap; margin-bottom: 12px; overflow-x: auto;
}
.formula-explanation { font-size: 12px; color: var(--text-secondary); line-height: 1.7; margin-bottom: 12px; }
.formula-variables { margin-top: 8px; }
.formula-variables table { width: 100%; font-size: 11px; }
.formula-variables th { text-align: left; padding: 4px 8px; background: #eef2f5; font-size: 10px; }
.formula-variables td { padding: 4px 8px; border-bottom: 1px solid #eef2f5; }
.formula-citation { font-size: 11px; color: var(--text-muted); margin-top: 8px; font-style: italic; }
.formula-citation a { color: var(--accent); }

.cr-card { border: 1px solid var(--border); border-radius: 8px; padding: 14px 18px; margin-bottom: 10px; background: var(--card); }
.cr-header { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.cr-formula-name { font-weight: 600; font-size: 13px; }
.cr-priority { font-size: 10px; font-weight: 700; text-transform: uppercase; padding: 2px 8px; border-radius: 10px; }
.cr-priority-low { background: #e8f5e9; color: #388e3c; }
.cr-priority-medium { background: #fff3e0; color: #f57c00; }
.cr-priority-high { background: #fce4ec; color: #d32f2f; }
.cr-priority-critical { background: #f44336; color: #fff; }
.cr-status { font-size: 10px; font-weight: 700; text-transform: uppercase; padding: 2px 8px; border-radius: 10px; }
.cr-status-pending { background: #fff3e0; color: #f57c00; }
.cr-status-in-progress { background: #e3f2fd; color: #1976d2; }
.cr-status-implemented { background: #e8f5e9; color: #388e3c; }
.cr-status-rejected { background: #fce4ec; color: #d32f2f; }

.changelog-entry {
  display: grid; grid-template-columns: 160px 1fr 100px 100px 80px;
  gap: 10px; padding: 8px 14px; border-bottom: 1px solid var(--border);
  font-size: 12px; align-items: center;
}
.changelog-entry:hover { background: var(--accent-light); }
.cl-time { font-size: 11px; color: var(--text-muted); }
.cl-name { font-weight: 600; }
.cl-values { font-family: 'JetBrains Mono', monospace; font-size: 11px; }
.cl-old { color: #e74c3c; text-decoration: line-through; }
.cl-new { color: #27ae60; font-weight: 700; }
.cl-reason { font-size: 11px; color: var(--text-secondary); }

/* ══════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════ */
/* Hamburger button — hidden on desktop */
.hamburger-btn {
  display: none;
  background: none; border: none; color: var(--text-primary);
  font-size: 20px; cursor: pointer; padding: 8px; margin-right: 8px;
  border-radius: var(--radius);
}
.hamburger-btn:hover { background: rgba(0,0,0,0.05); }

/* Sidebar overlay for mobile */
.sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.5); z-index: 99;
}
.sidebar-overlay.active { display: block; }

/* Wrap all data tables for horizontal scroll */
.table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }

@media (max-width: 1200px) {
  .design-cards { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
  .form-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
}

@media (max-width: 900px) {
  .login-container { flex-direction: column; gap: 30px; padding: 24px; }
  .login-hero { max-width: 100%; text-align: center; }
  .login-hero h1 { font-size: 28px; }
  .hero-features { align-items: center; }
  .hero-products { justify-content: center; }
  .login-card { width: 100%; max-width: 420px; }
}

@media (max-width: 768px) {
  .hamburger-btn { display: block; }

  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    width: 260px; min-width: 260px;
  }
  .sidebar.sidebar-open { transform: translateX(0); }

  .main-content { margin-left: 0 !important; }

  .top-bar { padding: 12px 16px; }
  .top-bar h2 { font-size: 16px; }
  .badge { font-size: 9px; padding: 4px 8px; }

  .content-area { padding: 16px; }

  .design-cards { grid-template-columns: 1fr; }

  .modal-content { max-width: 100%; margin: 8px; border-radius: 8px; max-height: 95vh; }

  .comparison-table { font-size: 11px; }
  .comparison-table th, .comparison-table td { padding: 6px 8px; white-space: nowrap; }

  .compare-radar-container { max-width: 100%; padding: 16px; }

  .admin-tabs { flex-wrap: wrap; gap: 4px; }
  .admin-tabs .btn { font-size: 11px; padding: 6px 10px; }

  .detail-table td { font-size: 12px; padding: 6px 10px; }
}

@media (max-width: 480px) {
  .login-hero { display: none; }
  .login-card { padding: 24px 20px; border-radius: 12px; }
  .login-card h2 { font-size: 20px; }

  .form-grid { grid-template-columns: 1fr; }
  .pricing-section .form-grid { grid-template-columns: 1fr; }

  .card-body { grid-template-columns: 1fr; }

  .card-footer { flex-wrap: wrap; justify-content: center; }
  .card-footer .btn { flex: 1; min-width: 70px; font-size: 11px; }

  .results-header { flex-direction: column; gap: 8px; align-items: flex-start; }

  .modal-actions { gap: 4px; }
  .modal-actions .btn { padding: 6px 10px; font-size: 11px; }
  .modal-header { padding: 12px 16px; }
  .modal-body { padding: 14px 16px; }

  .section-card-header { font-size: 13px; padding: 10px 14px; }

  .comparison-header { flex-direction: column; gap: 8px; align-items: flex-start; }

  .top-bar { flex-wrap: wrap; gap: 6px; }
}
