/* ===================================================================
   Secure Firmware Portal - Modern White Theme
   100% Offline-Capable CSS3 Stylesheet
   =================================================================== */

:root {
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --bg-alt: #f1f5f9;
  --border-color: #e2e8f0;
  --border-focus: #3b82f6;
  
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-dim: #94a3b8;
  
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  
  --success: #10b981;
  --success-bg: #ecfdf5;
  --success-border: #a7f3d0;
  
  --danger: #ef4444;
  --danger-bg: #fef2f2;
  --danger-border: #fecaca;
  
  --warning: #f59e0b;
  --warning-bg: #fffbeb;
  --warning-border: #fde68a;
  
  --terminal-bg: #0f172a;
  --terminal-text: #38bdf8;
  --terminal-line: #94a3b8;
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Header & Top Bar */
.navbar {
  background-color: #ffffff;
  border-bottom: 1px solid var(--border-color);
  padding: 0.75rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 1rem;
}

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

.brand-divider {
  width: 1px;
  height: 32px;
  background-color: var(--border-color);
}

.brand-logo {
  width: 36px;
  height: 36px;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.brand-title p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.nav-status-items {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge-success { background: var(--success-bg); color: #065f46; border: 1px solid var(--success-border); }
.badge-danger { background: var(--danger-bg); color: #991b1b; border: 1px solid var(--danger-border); }
.badge-warning { background: var(--warning-bg); color: #92400e; border: 1px solid var(--warning-border); }
.badge-info { background: var(--primary-light); color: var(--primary); border: 1px solid #bfdbfe; }
.badge-neutral { background: var(--bg-alt); color: var(--text-muted); border: 1px solid var(--border-color); }

/* Layout: Sidebar + Main Content */
.app-container {
  display: flex;
  flex: 1;
  min-width: 0;
  overflow-x: hidden;
}

.app-container-no-sidebar {
  justify-content: center;
}

.app-container-no-sidebar .content-area {
  max-width: 1080px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

.sidebar {
  width: 250px;
  min-width: 250px;
  flex-shrink: 0;
  background: #ffffff;
  border-right: 1px solid var(--border-color);
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.15s ease-in-out;
  cursor: pointer;
}

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

.nav-link.active {
  background-color: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.content-area {
  flex: 1;
  min-width: 0;
  padding: 1.5rem 2rem;
  overflow-y: auto;
  overflow-x: hidden;
  max-width: 1400px;
}

/* Sections */
.tab-content {
  display: none;
}
.tab-content.active {
  display: block;
}

.section-header {
  margin-bottom: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.section-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.section-header p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* Cards & Grid */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  position: relative;
  transition: box-shadow 0.2s ease;
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.card-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-main);
}

.card-subtext {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

/* Flight Controller Highlight Card */
.fc-card {
  background: #ffffff;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Redundant action buttons and status badges removed from UI */
#dash-fc-secure,
#dash-fc-flash-btn,
#btn-unified-disconnect {
  display: none !important;
}

.fc-card.connected {
  border-color: #93c5fd;
  background: linear-gradient(to right, #ffffff, #f8fafc);
}

.fc-info-group {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.fc-icon-indicator {
  width: 54px;
  height: 54px;
  border-radius: var(--radius-md);
  background: var(--bg-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--text-muted);
}

.fc-icon-indicator.active {
  background: var(--success-bg);
  color: var(--success);
}

/* Tables */
.table-container {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  width: 100%;
}

.card .table-container,
.card > .table-container {
  box-shadow: none;
  margin-bottom: 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.85rem;
  table-layout: auto;
}

th {
  background-color: var(--bg-alt);
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
  font-size: 0.82rem;
  vertical-align: middle;
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background-color: #f8fafc;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.55rem 1.15rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease-in-out;
}

.btn-primary {
  background-color: var(--primary);
  color: white;
}
.btn-primary:hover {
  background-color: var(--primary-hover);
}

.btn-secondary {
  background-color: var(--bg-alt);
  color: var(--text-main);
  border-color: var(--border-color);
}
.btn-secondary:hover {
  background-color: #e2e8f0;
}

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

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.78rem;
}

/* Category Tabs */
.filter-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.filter-tab {
  padding: 0.45rem 1rem;
  border-radius: var(--radius-sm);
  background: #ffffff;
  border: 1px solid var(--border-color);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
}

.filter-tab.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* Wizard / Flashing Steps */
.wizard-step-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}

.step-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.step-number {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  font-size: 0.85rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Terminal Console */
.terminal-box {
  background-color: var(--terminal-bg);
  border-radius: var(--radius-md);
  padding: 1rem;
  color: var(--terminal-text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.8rem;
  line-height: 1.45;
  height: 320px;
  overflow-y: auto;
  border: 1px solid #1e293b;
  margin-top: 1rem;
}

.terminal-line {
  color: var(--terminal-line);
  margin-bottom: 2px;
}
.terminal-line.success { color: #4ade80; font-weight: 600; }
.terminal-line.error { color: #f87171; font-weight: 600; }
.terminal-line.highlight { color: #38bdf8; font-weight: 600; }

/* Progress Bar */
.progress-container {
  width: 100%;
  height: 16px;
  background-color: #e2e8f0;
  border-radius: 9999px;
  overflow: hidden;
  margin: 1rem 0;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #3b82f6, #10b981);
  transition: width 0.3s ease;
}

/* Modals */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(2px);
  z-index: 1050;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  overflow-y: auto;
}
.modal-overlay.active {
  display: flex;
}

.modal-dialog {
  background: #ffffff;
  border-radius: var(--radius-lg);
  max-width: 650px;
  width: 100%;
  max-height: calc(100vh - 3rem);
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.25), 0 10px 10px -5px rgba(0, 0, 0, 0.15);
  overflow: hidden;
  border: 1px solid var(--border-color);
  margin: auto;
}

.modal-header {
  padding: 1.15rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}
.modal-body {
  padding: 1.25rem 1.5rem;
  overflow-y: auto;
  flex: 1 1 auto;
}
.modal-footer {
  padding: 1rem 1.5rem;
  background: var(--bg-alt);
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  flex-shrink: 0;
}

/* Drag and Drop Zone */
.dropzone {
  border: 2px dashed #93c5fd;
  background-color: var(--primary-light);
  border-radius: var(--radius-md);
  padding: 2.5rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s;
}
.dropzone:hover {
  border-color: var(--primary);
}

/* Code Snippets */
code, pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}
.code-pill {
  background: var(--bg-alt);
  padding: 0.15rem 0.4rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  border: 1px solid var(--border-color);
}

/* ===================================================================
   Unified Multi-Portal Layout Enhancements & Permission Controls
   =================================================================== */

.nav-link.nav-link-locked {
  color: var(--text-dim);
  display: flex;
  align-items: center;
  position: relative;
}

.nav-link.nav-link-locked:hover {
  background-color: #f8fafc;
  color: var(--text-muted);
}

.tab-lock-icon {
  margin-left: auto;
  font-size: 0.8rem;
  opacity: 0.75;
  filter: grayscale(1);
}

.portal-role-pill {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  text-transform: uppercase;
}

.portal-role-dev {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

.portal-role-admin {
  background: #f3e8ff;
  color: #7e22ce;
  border: 1px solid #e9d5ff;
}

.portal-role-client {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
}

/* Form inputs & interactive rows */
.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.form-control, .dev-input, .adm-input {
  width: 100%;
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  background-color: #ffffff;
  color: var(--text-main);
  outline: none;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus, .dev-input:focus, .adm-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* Terminal & Log Box */
.log-box {
  background: #0f172a;
  color: #38bdf8;
  font-family: ui-monospace, Menlo, Monaco, monospace;
  font-size: 0.8rem;
  padding: 1rem;
  border-radius: var(--radius-sm);
  max-height: 380px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
  border: 1px solid #1e293b;
}

/* Permission Matrix Table */
.perm-matrix-table th {
  background: #f8fafc;
  text-align: center;
  font-size: 0.78rem;
  padding: 0.75rem 0.5rem;
  border-bottom: 2px solid var(--border-color);
}

.perm-matrix-table th:first-child {
  text-align: left;
}

.perm-matrix-table td {
  padding: 0.65rem 0.5rem;
  text-align: center;
  vertical-align: middle;
  border-bottom: 1px solid var(--border-color);
}

.perm-matrix-table td:first-child {
  text-align: left;
}

.perm-checkbox {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--primary);
}

.perm-checkbox:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

/* Restricted Module Access Card */
.restricted-access-panel {
  max-width: 680px;
  margin: 3rem auto;
  background: #ffffff;
  border: 1px solid #fed7aa;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 2.5rem 2rem;
  text-align: center;
}

/* ===================================================================
   Connect Button & Dropdown Menu (Betaflight / GCS Configurator Style)
   =================================================================== */
.connect-btn-group {
  position: relative;
  display: inline-flex;
  align-items: stretch;
  border-radius: var(--radius-sm);
  background: #142917;
  border: 1.5px solid #22c55e;
  box-shadow: 0 1px 3px rgba(34, 197, 94, 0.2);
  transition: all 0.2s ease;
  margin-left: 0.5rem;
}

.connect-btn-group:hover {
  border-color: #4ade80;
  box-shadow: 0 0 8px rgba(74, 222, 128, 0.35);
}

.connect-btn-group.connected {
  background: #0f381e;
  border-color: #10b981;
}

.connect-btn-group.connecting {
  background: #0f172a;
  border-color: #38bdf8;
}

.btn-connect-main {
  background: transparent;
  border: none;
  color: #4ade80;
  padding: 0.4rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  outline: none;
  border-top-left-radius: var(--radius-sm);
  border-bottom-left-radius: var(--radius-sm);
  transition: background-color 0.15s ease, color 0.15s ease;
}

.btn-connect-main:hover {
  background-color: rgba(74, 222, 128, 0.15);
  color: #86efac;
}

.connect-btn-group.connected .btn-connect-main {
  color: #a7f3d0;
}

.connect-btn-group.connecting .btn-connect-main {
  color: #38bdf8;
}

.btn-connect-toggle {
  background: transparent;
  border: none;
  border-left: 1px solid rgba(34, 197, 94, 0.35);
  color: #4ade80;
  padding: 0.4rem 0.6rem;
  font-size: 0.75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  outline: none;
  border-top-right-radius: var(--radius-sm);
  border-bottom-right-radius: var(--radius-sm);
  transition: background-color 0.15s ease;
}

.btn-connect-toggle:hover {
  background-color: rgba(74, 222, 128, 0.2);
}

.dropdown-arrow {
  display: inline-block;
  transition: transform 0.2s ease;
}

.dropdown-arrow.open {
  transform: rotate(180deg);
}

/* Dropdown Menu Container (matching dark screenshot) */
.connect-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background-color: #18181b;
  border: 1px solid #3f3f46;
  border-radius: 8px;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.45), 0 2px 6px rgba(0, 0, 0, 0.2);
  min-width: 280px;
  padding: 6px 0;
  z-index: 1000;
  display: none;
  flex-direction: column;
}

.connect-dropdown-menu.show {
  display: flex;
  animation: fadeInDown 0.15s ease;
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.connect-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1rem;
  color: #a1a1aa;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.connect-dropdown-item:hover {
  background-color: #27272a;
  color: #ffffff;
}

.connect-dropdown-item .item-icon {
  font-size: 1rem;
  width: 20px;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.connect-dropdown-item.item-auto-connect {
  color: #f4f4f5;
  font-weight: 600;
}

.connect-dropdown-item.item-auto-connect:hover {
  color: #4ade80;
  background-color: #142917;
}

.connect-dropdown-item.item-danger {
  color: #f87171;
}

.connect-dropdown-item.item-danger:hover {
  background-color: #450a0a;
  color: #fca5a5;
}

.connect-dropdown-divider {
  height: 1px;
  background-color: #27272a;
  margin: 5px 0;
}

/* Port Inspection Modal Cards */
.inspect-port-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: var(--bg-alt);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  margin-bottom: 0.5rem;
  transition: all 0.15s ease;
}

.inspect-port-card:hover {
  border-color: var(--primary);
  background: #ffffff;
}

.inspect-port-card.candidate {
  border-left: 4px solid #10b981;
}

/* ===================================================================
   Unified Flight Controller Connection & Secure Flashing Page Styles
   Matching Modern Chromium & Light Grey Theme Reference Design
   =================================================================== */

.unified-flashing-container {
  max-width: 880px;
  margin: 0 auto;
  padding: 1rem 0.5rem 3rem;
}

.unified-flashing-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.unified-flashing-header-left {
  flex: 1;
  min-width: 280px;
}

.unified-flashing-header-right {
  display: flex;
  align-items: center;
  padding-top: 0.25rem;
}

.btn-unified-import-bundle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #334155;
  font-size: 0.86rem;
  font-weight: 600;
  border-radius: 8px;
  padding: 0.55rem 1.05rem;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: all 0.15s ease;
  user-select: none;
}

.btn-unified-import-bundle:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #0f172a;
}

.unified-flashing-title {
  font-size: 1.85rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.025em;
  margin-bottom: 0.35rem;
}

.unified-flashing-subtitle {
  font-size: 0.95rem;
  color: #64748b;
  line-height: 1.5;
}

/* Firmware Family Selection Tabs */
.fw-family-tabs {
  display: inline-flex;
  align-items: center;
  background: #e2e8f0;
  padding: 4px;
  border-radius: 12px;
  gap: 4px;
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
}

.fw-family-tab {
  background: transparent;
  border: none;
  padding: 0.55rem 1.25rem;
  border-radius: 9px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.15s ease;
  user-select: none;
}

.fw-family-tab.active {
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.fw-family-tab.disabled {
  color: #64748b;
  cursor: pointer;
}

.fw-family-tab:hover:not(.active) {
  color: #1e293b;
}

.soon-badge {
  font-size: 0.65rem;
  font-weight: 700;
  background: #cbd5e1;
  color: #334155;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Main Unified White Card */
.unified-workflow-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
  padding: 2rem 2.25rem;
}

/* Sections */
.unified-section {
  padding: 0.5rem 0;
}

.unified-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.unified-section-title-group {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.unified-step-circle {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 50%;
  background: #eff6ff;
  color: #2563eb;
  font-weight: 700;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.unified-step-circle.verified {
  background: #059669;
  color: #ffffff;
}

.unified-section-heading {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.unified-heading-text {
  font-size: 1.18rem;
  font-weight: 700;
  color: #0f172a;
}

/* Status Pills */
.unified-pill {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.22rem 0.7rem;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  line-height: 1.2;
}

.unified-pill-success {
  background: #dcfce7;
  color: #15803d;
}

.unified-pill-info {
  background: #e0f2fe;
  color: #0369a1;
}

.unified-pill-warning {
  background: #fef3c7;
  color: #b45309;
}

.unified-pill-neutral {
  background: #f1f5f9;
  color: #64748b;
}

.unified-pill-danger {
  background: #fee2e2;
  color: #b91c1c;
}

/* Outline Action Buttons */
.btn-unified-outline {
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #0f172a;
  font-weight: 600;
  border-radius: 8px;
  padding: 0.5rem 1.25rem;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.15s ease;
  user-select: none;
}

.btn-unified-outline:hover {
  background: #f8fafc;
  border-color: #94a3b8;
}

/* Device Metadata Card */
.unified-device-card {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  margin-top: 1.35rem;
  margin-left: 2.85rem;
}

.unified-chip-icon {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 10px;
  background: #eff6ff;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #2563eb;
}

.unified-device-meta {
  display: flex;
  flex-direction: column;
}

.unified-device-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
}

.unified-device-subtitle {
  font-size: 0.85rem;
  color: #64748b;
  margin-top: 0.2rem;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, monospace;
}

.unified-disconnected-prompt {
  margin-top: 1rem;
  margin-left: 2.85rem;
  font-size: 0.88rem;
  color: #64748b;
}

/* Secure Bootloader Status Banners */
.unified-bl-banner {
  border-radius: 8px;
  padding: 0.95rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1.25rem;
  margin-left: 2.85rem;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.unified-bl-warning {
  background: #fef3c7;
  border: 1px solid #fde68a;
  color: #78350f;
}

.unified-bl-verified {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
}

.unified-bl-info {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
}

.unified-bl-text-group {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  font-size: 0.88rem;
  line-height: 1.45;
}

.btn-unified-outline-banner {
  background: #ffffff;
  border: 1px solid #d1d5db;
  color: #0f172a;
  font-weight: 600;
  border-radius: 8px;
  padding: 0.5rem 1.15rem;
  cursor: pointer;
  font-size: 0.86rem;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: all 0.15s ease;
}

.btn-unified-outline-banner:hover {
  background: #f9fafb;
  border-color: #9ca3af;
}

/* Section Dividers */
.unified-divider {
  height: 1px;
  background: #f1f5f9;
  margin: 1.5rem 0;
}

/* Firmware Selection Box */
.unified-fw-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-top: 1.25rem;
  margin-left: 2.85rem;
}

.unified-fw-main-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.unified-fw-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
}

.unified-fw-meta {
  font-size: 0.88rem;
  color: #64748b;
  font-weight: 500;
}

.unified-empty-fw {
  margin-top: 1rem;
  margin-left: 2.85rem;
  font-size: 0.88rem;
  color: #64748b;
}

/* Flash Primary Action */
.unified-flash-row {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.unified-flash-btn-group {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.btn-unified-flash {
  background: #1d4ed8;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 700;
  padding: 0.75rem 1.85rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: all 0.15s ease;
  user-select: none;
}

.btn-unified-flash:hover:not(:disabled) {
  background: #1e40af;
}

.btn-unified-flash:disabled {
  background: #94a3b8;
  cursor: not-allowed;
  opacity: 0.75;
}

.unified-flash-hint {
  font-size: 0.88rem;
  color: #475569;
  line-height: 1.5;
  max-width: 520px;
}

/* Footer Helper Note */
.unified-page-footer-note {
  text-align: center;
  color: #64748b;
  font-size: 0.82rem;
  margin-top: 1.75rem;
  line-height: 1.5;
}

/* Bootloader Details & Security Assessment Collapsible */
.unified-bl-details-wrapper {
  margin-top: 1rem;
  margin-left: 2.85rem;
}

.btn-bl-details-toggle {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.65rem 1rem;
  cursor: pointer;
  font-size: 0.88rem;
  transition: all 0.15s ease;
  user-select: none;
}

.btn-bl-details-toggle:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.unified-bl-details-content {
  margin-top: 0.85rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 1.25rem;
  background: #f8fafc;
}

/* Responsive Rules */
@media (max-width: 768px) {
  .unified-device-card,
  .unified-bl-banner,
  .unified-fw-card,
  .unified-disconnected-prompt,
  .unified-empty-fw,
  .unified-bl-progress-box,
  .unified-bl-details-wrapper {
    margin-left: 0;
  }
  .unified-workflow-card {
    padding: 1.25rem 1rem;
  }
  .unified-flash-row {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* =======================================================
   Unified Releases & Settings UI Enhancements
   ======================================================= */

/* Step indicators */
.steps-nav {
  display: flex;
  gap: 6px;
  align-items: center;
}

.step-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  color: #64748b;
  background: #f1f5f9;
  user-select: none;
}

.step-badge .step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-size: 0.72rem;
  font-weight: 700;
  background: #cbd5e1;
  color: #334155;
}

.step-badge.on {
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 600;
}

.step-badge.on .step-num {
  background: #2563eb;
  color: #ffffff;
}

.step-badge.done {
  background: #ecfdf5;
  color: #059669;
  font-weight: 600;
}

.step-badge.done .step-num {
  background: #10b981;
  color: #ffffff;
}

/* Release filter buttons */
.release-filter-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.release-filter-btn {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 0.82rem;
  font-weight: 500;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s ease;
}

.release-filter-btn:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.release-filter-btn.active {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
  font-weight: 600;
}

/* Switch toggles */
.switch-toggle {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 22px;
}

.switch-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider-toggle {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #cbd5e1;
  transition: 0.25s;
  border-radius: 22px;
}

.slider-toggle:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.25s;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.switch-toggle input:checked + .slider-toggle {
  background-color: #2563eb;
}

.switch-toggle input:checked + .slider-toggle:before {
  transform: translateX(20px);
}


