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

:root {
  --primary-color: #005eb8;
  --primary-hover: #004a91;
  --secondary-color: #1a1a2e;
  --background-color: #0f0f1a;
  --panel-background: #1a1a2e;
  --border-color: #2a2a4a;
  --success-color: #00c853;
  --success-bg: rgba(0, 200, 83, 0.1);
  --error-color: #ff1744;
  --error-bg: rgba(255, 23, 68, 0.1);
  --text-color: #e0e0e0;
  --text-muted: #8888aa;
  --sidebar-bg: #12122a;
  --accent-cyan: #00bcd4;
  --accent-blue: #2196f3;
  --ge-blue: #005eb8;
}

body {
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, 'Helvetica Neue', Arial, sans-serif;
  background-color: var(--background-color);
  color: var(--text-color);
  line-height: 1.5;
}

.container {
  display: grid;
  grid-template-areas:
    "header header"
    "sidebar main"
    "footer footer";
  grid-template-columns: 240px 1fr;
  grid-template-rows: 64px 1fr 40px;
  min-height: 100vh;
}

/* Header */
.header {
  grid-area: header;
  background: linear-gradient(135deg, #001a33 0%, #003366 50%, #001a33 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  box-shadow: 0 2px 12px rgba(0, 94, 184, 0.3);
  border-bottom: 2px solid var(--accent-cyan);
}

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

.ge-logo {
  font-size: 28px;
  font-weight: 900;
  color: white;
  background: var(--ge-blue);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-style: italic;
  letter-spacing: -1px;
  border: 2px solid #66aadd;
  box-shadow: 0 0 15px rgba(0, 94, 184, 0.5);
}

.logo-text-group {
  display: flex;
  flex-direction: column;
}

.logo-text {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 1px;
}

.logo-sub {
  font-size: 11px;
  color: var(--accent-cyan);
  letter-spacing: 2px;
  text-transform: uppercase;
}

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

.scan-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  position: relative;
}

.pulse-ring {
  position: absolute;
  left: -2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid #10b981;
  animation: pulse-ring 2s infinite;
}

@keyframes pulse-ring {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.5); opacity: 0; }
  100% { transform: scale(1); opacity: 0; }
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: #6b7280;
}

.status-dot.online {
  background-color: #10b981;
  box-shadow: 0 0 10px #10b981;
}

.magnet-temp {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--accent-cyan);
  font-family: 'Courier New', monospace;
  background: rgba(0, 188, 212, 0.1);
  padding: 4px 12px;
  border-radius: 4px;
  border: 1px solid rgba(0, 188, 212, 0.2);
}

/* Sidebar */
.sidebar {
  grid-area: sidebar;
  background-color: var(--sidebar-bg);
  padding: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border-color);
}

.sidebar-section {
  padding: 8px 0;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--text-muted);
  padding: 12px 20px 4px;
  text-transform: uppercase;
}

.sidebar ul {
  list-style: none;
}

.sidebar a {
  display: block;
  padding: 10px 20px;
  color: #7788aa;
  text-decoration: none;
  font-size: 13px;
  transition: all 0.2s;
  border-left: 3px solid transparent;
}

.sidebar a:hover {
  background-color: rgba(0, 188, 212, 0.05);
  color: white;
}

.sidebar a.active {
  background-color: rgba(0, 188, 212, 0.1);
  color: var(--accent-cyan);
  border-left-color: var(--accent-cyan);
}

.sidebar-warning {
  margin-top: auto;
  padding: 16px;
  background: rgba(255, 152, 0, 0.08);
  border-top: 1px solid rgba(255, 152, 0, 0.2);
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.warning-icon {
  font-size: 20px;
}

.warning-text {
  font-size: 11px;
  color: #ff9800;
  line-height: 1.4;
}

/* Main Content */
.main-content {
  grid-area: main;
  padding: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: flex-start;
  align-content: flex-start;
}

/* MRI Hero Image */
.mri-hero {
  width: 100%;
  height: 180px;
  background: linear-gradient(135deg, #001a33 0%, #003366 30%, #001a44 60%, #000d1a 100%);
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  border: 1px solid var(--border-color);
}

.mri-hero::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 120px;
  height: 120px;
  border: 3px solid rgba(0, 188, 212, 0.3);
  border-radius: 50%;
  box-shadow: 0 0 40px rgba(0, 188, 212, 0.15), inset 0 0 40px rgba(0, 188, 212, 0.05);
}

.mri-hero::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80px;
  height: 80px;
  border: 2px solid rgba(0, 188, 212, 0.2);
  border-radius: 50%;
  animation: scan-pulse 3s ease-in-out infinite;
}

@keyframes scan-pulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.3; }
  50% { transform: translate(-50%, -50%) scale(1.3); opacity: 0.6; }
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, rgba(0,26,51,0.9) 0%, rgba(0,26,51,0.3) 40%, rgba(0,26,51,0.3) 60%, rgba(0,26,51,0.9) 100%);
  display: flex;
  align-items: center;
  padding: 0 32px;
}

.hero-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hero-badge {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--accent-cyan);
  background: rgba(0, 188, 212, 0.1);
  border: 1px solid rgba(0, 188, 212, 0.3);
  padding: 6px 16px;
  border-radius: 4px;
  display: inline-block;
}

/* Grid lines effect */
.mri-hero {
  background-image: 
    linear-gradient(rgba(0, 188, 212, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 188, 212, 0.03) 1px, transparent 1px);
  background-size: 20px 20px;
}

.panel {
  flex: 1;
  min-width: 400px;
  background-color: var(--panel-background);
  border-radius: 12px;
  padding: 32px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.panel h1 {
  font-size: 22px;
  font-weight: 600;
  color: #fff;
}

.panel-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #ff9800;
  background: rgba(255, 152, 0, 0.1);
  border: 1px solid rgba(255, 152, 0, 0.3);
  padding: 4px 10px;
  border-radius: 4px;
}

.panel-description {
  color: var(--text-muted);
  margin-bottom: 24px;
  font-size: 14px;
}

/* Notification */
.notification {
  padding: 16px;
  border-radius: 8px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.notification.hidden {
  display: none;
}

.notification.success {
  background-color: var(--success-bg);
  color: var(--success-color);
  border: 1px solid rgba(0, 200, 83, 0.3);
}

.notification.error {
  background-color: var(--error-bg);
  color: var(--error-color);
  border: 1px solid rgba(255, 23, 68, 0.3);
}

/* Form */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-weight: 500;
  margin-bottom: 6px;
  font-size: 13px;
  color: #aab;
}

.form-group input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: #0f0f22;
  color: #e0e0e0;
}

.form-group input:focus {
  outline: none;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px rgba(0, 188, 212, 0.15);
}

.form-group input::placeholder {
  color: #555;
}

.form-group .hint {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--ge-blue), #0077cc);
  color: white;
  border: none;
  padding: 14px 28px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
  letter-spacing: 0.5px;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #0077cc, #0088dd);
  box-shadow: 0 4px 15px rgba(0, 94, 184, 0.4);
}

.btn-primary:disabled {
  background: #333;
  cursor: not-allowed;
}

.btn-loading {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-loading::before {
  content: '';
  width: 16px;
  height: 16px;
  border: 2px solid white;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.hidden {
  display: none !important;
}

/* Side Panels */
.side-panels {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 280px;
}

.credentials-info, .device-info, .helium-info {
  background-color: var(--panel-background);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
}

.credentials-info {
  border-left: 4px solid var(--accent-cyan);
}

.credentials-info h3, .device-info h3, .helium-info h3 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 14px;
  color: #ccc;
}

.credentials-info dl, .device-info dl, .helium-info dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 14px;
}

.credentials-info dt, .device-info dt, .helium-info dt {
  font-size: 12px;
  color: var(--text-muted);
}

.credentials-info dd, .device-info dd, .helium-info dd {
  font-size: 12px;
  font-weight: 500;
  color: #bbc;
}

.credentials-info dd#current-password {
  font-family: 'Courier New', monospace;
  background-color: rgba(0, 188, 212, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
}

.no-credentials {
  color: var(--text-muted);
  font-size: 13px;
  font-style: italic;
}

/* Helium Gauge */
.helium-gauge {
  margin-bottom: 12px;
}

.gauge-bar {
  width: 100%;
  height: 8px;
  background: #1a1a33;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 6px;
}

.gauge-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-cyan), #00e5ff);
  border-radius: 4px;
  transition: width 0.5s;
}

.gauge-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
}

.gauge-ok {
  color: var(--success-color);
}

/* Footer */
.footer {
  grid-area: footer;
  background-color: #0a0a1a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: #555;
  border-top: 1px solid var(--border-color);
}

/* Responsive */
@media (max-width: 900px) {
  .container {
    grid-template-areas:
      "header"
      "main"
      "footer";
    grid-template-columns: 1fr;
    grid-template-rows: 64px 1fr 40px;
  }

  .sidebar {
    display: none;
  }

  .main-content {
    flex-direction: column;
  }

  .side-panels {
    width: 100%;
  }

  .panel {
    min-width: unset;
  }
}
