@charset "UTF-8";
/* ============================================================
   meta.css — Dark theme for Lumo Meta Management Panel
   ============================================================ */

:root {
  --bg-primary: #0a0a12;
  --bg-secondary: #12121f;
  --bg-card: #1a1a2e;
  --bg-card-hover: #22223a;
  --bg-input: #16162a;
  --border-color: #2a2a4a;
  --border-hover: #3a3a6a;
  --text-primary: #e0e0f0;
  --text-secondary: #8888aa;
  --text-muted: #55557a;
  --accent-blue: #4a8aff;
  --accent-cyan: #00d4ff;
  --accent-green: #2ecc71;
  --accent-yellow: #f1c40f;
  --accent-orange: #e67e22;
  --accent-red: #e74c3c;
  --accent-purple: #9b59b6;
  --shadow: 0 2px 12px rgba(0,0,0,0.4);
  --radius: 8px;
  --radius-sm: 4px;
  --transition: 0.2s ease;
  --font-mono: "Cascadia Code", "Fira Code", "Consolas", monospace;
  --font-sans: "Segoe UI", -apple-system, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  overflow: hidden;
}

/* ─── Scrollbar ─────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-hover); }

/* ─── Layout ────────────────────────── */
.app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

/* ─── Top Navbar ────────────────────── */
.navbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 20px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
  height: 48px;
}

.navbar .logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 600;
  color: var(--accent-cyan);
}
.navbar .logo .badge {
  font-size: 10px;
  font-weight: 500;
  background: var(--accent-blue);
  color: #fff;
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  opacity: 0.8;
}
.navbar .nav-tabs {
  display: flex;
  gap: 4px;
  margin-left: 16px;
}
.navbar .nav-tab {
  padding: 6px 14px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: var(--radius-sm);
  font-size: 13px;
  transition: var(--transition);
}
.navbar .nav-tab:hover { color: var(--text-primary); background: var(--bg-card); }
.navbar .nav-tab.active {
  color: var(--accent-cyan);
  background: rgba(0,212,255,0.1);
}
.navbar .connection-status {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
}
.navbar .status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.navbar .status-dot.online { background: var(--accent-green); box-shadow: 0 0 6px var(--accent-green); }
.navbar .status-dot.offline { background: var(--accent-red); box-shadow: 0 0 6px var(--accent-red); }
.navbar .status-dot.reconnecting { background: var(--accent-yellow); animation: pulse-dot 1s infinite; }

@keyframes pulse-dot { 0%,100%{opacity:1} 50%{opacity:0.4} }

/* ─── Error Banner ──────────────────── */
.error-banner {
  display: none;
  padding: 8px 20px;
  background: rgba(231,76,60,0.15);
  border-bottom: 1px solid var(--accent-red);
  color: var(--accent-red);
  font-size: 13px;
  flex-shrink: 0;
}
.error-banner.visible { display: block; }

/* ─── Main Content ──────────────────── */
.main-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

/* ─── Panel Grid ────────────────────── */
.panel-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 12px;
  height: 100%;
  min-height: 0;
}

.panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}
.panel-header h3 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.panel-header .panel-actions {
  display: flex;
  gap: 6px;
}
.panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px 14px;
}

/* ─── Buttons ────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  border: 1px solid var(--border-color);
  background: var(--bg-input);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  font-size: 12px;
  cursor: pointer;
  transition: var(--transition);
}
.btn:hover { border-color: var(--border-hover); background: var(--bg-card-hover); }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-primary { background: var(--accent-blue); border-color: var(--accent-blue); color: #fff; }
.btn-primary:hover { background: #3a7aef; }
.btn-danger { background: var(--accent-red); border-color: var(--accent-red); color: #fff; }
.btn-danger:hover { background: #d63031; }
.btn-success { background: var(--accent-green); border-color: var(--accent-green); color: #fff; }
.btn-success:hover { background: #27ae60; }
.btn-sm { padding: 3px 8px; font-size: 11px; }

/* ─── Cards ──────────────────────────── */
.stat-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}
.stat-card .stat-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.stat-card .stat-info { flex: 1; }
.stat-card .stat-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.3px; }
.stat-card .stat-value { font-size: 20px; font-weight: 700; color: var(--text-primary); font-family: var(--font-mono); }
.stat-card .stat-detail { font-size: 11px; color: var(--text-secondary); margin-top: 2px; }

.stat-icon.blue { background: rgba(74,138,255,0.15); color: var(--accent-blue); }
.stat-icon.green { background: rgba(46,204,113,0.15); color: var(--accent-green); }
.stat-icon.yellow { background: rgba(241,196,15,0.15); color: var(--accent-yellow); }
.stat-icon.red { background: rgba(231,76,60,0.15); color: var(--accent-red); }
.stat-icon.purple { background: rgba(155,89,182,0.15); color: var(--accent-purple); }
.stat-icon.cyan { background: rgba(0,212,255,0.15); color: var(--accent-cyan); }

.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

/* ─── Tables ─────────────────────────── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.data-table th {
  text-align: left;
  padding: 6px 8px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-muted);
  font-weight: 500;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  position: sticky;
  top: 0;
  background: var(--bg-card);
}
.data-table td {
  padding: 6px 8px;
  border-bottom: 1px solid rgba(42,42,74,0.5);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 11px;
}
.data-table tr:hover td { background: var(--bg-card-hover); }
.data-table .status-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 500;
}
.status-badge.ok { background: rgba(46,204,113,0.2); color: var(--accent-green); }
.status-badge.warn { background: rgba(241,196,15,0.2); color: var(--accent-yellow); }
.status-badge.fail { background: rgba(231,76,60,0.2); color: var(--accent-red); }
.status-badge.info { background: rgba(74,138,255,0.2); color: var(--accent-blue); }
.status-badge.running { background: rgba(0,212,255,0.2); color: var(--accent-cyan); }

/* ─── Search Input ───────────────────── */
.search-box {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}
.search-box input {
  flex: 1;
  padding: 6px 10px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 12px;
  font-family: var(--font-mono);
  outline: none;
  transition: var(--transition);
}
.search-box input:focus { border-color: var(--accent-blue); }
.search-box input::placeholder { color: var(--text-muted); }

/* ─── KG Graph Display ──────────────── */
.graph-container {
  width: 100%;
  height: 200px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--text-muted);
}
.graph-container svg {
  width: 100%;
  height: 100%;
}
.graph-fallback {
  padding: 20px;
  text-align: left;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
  overflow: auto;
  max-height: 200px;
}

/* ─── Log Console ────────────────────── */
.log-console {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 8px;
  max-height: 200px;
  overflow-y: auto;
  line-height: 1.6;
}
.log-entry { display: flex; gap: 8px; padding: 2px 0; }
.log-time { color: var(--text-muted); white-space: nowrap; }
.log-type { font-weight: 500; min-width: 60px; }
.log-type.info { color: var(--accent-blue); }
.log-type.warn { color: var(--accent-yellow); }
.log-type.error { color: var(--accent-red); }
.log-type.success { color: var(--accent-green); }
.log-msg { color: var(--text-secondary); flex: 1; }

/* ─── Peer Cards ─────────────────────── */
.peer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.peer-card {
  padding: 10px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
}
.peer-card .peer-name { font-size: 13px; font-weight: 600; }
.peer-card .peer-detail { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.peer-card .peer-detail span { color: var(--text-secondary); }
.peer-card .peer-status {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 10px;
  margin-top: 4px;
}
.peer-card .peer-status.synced { background: rgba(46,204,113,0.2); color: var(--accent-green); }
.peer-card .peer-status.pending { background: rgba(241,196,15,0.2); color: var(--accent-yellow); }
.peer-card .peer-status.offline { background: rgba(231,76,60,0.2); color: var(--accent-red); }

/* ─── Loading Spinner ────────────────── */
.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid var(--border-color);
  border-top-color: var(--accent-cyan);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Empty State ────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-muted);
  font-size: 13px;
  gap: 6px;
}
.empty-state .empty-icon { font-size: 32px; opacity: 0.3; }

/* ─── Utility ────────────────────────── */
.flex-row { display: flex; align-items: center; gap: 8px; }
.flex-col { display: flex; flex-direction: column; gap: 8px; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--accent-green); }
.text-warning { color: var(--accent-yellow); }
.text-danger { color: var(--accent-red); }
.text-info { color: var(--accent-blue); }
.mt-2 { margin-top: 8px; }
.mb-2 { margin-bottom: 8px; }
.gap-2 { gap: 8px; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }


/* ??? Modal ???????????????????????????? */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(2px);
}
.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  width: 90%;
  max-width: 800px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
}
.modal-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent-cyan);
}
.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

/* ??? Law Cards ???????????????????????? */
.law-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 8px;
}
.law-card {
  padding: 10px 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  transition: var(--transition);
}
.law-card:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
}
.law-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}
.law-name {
  font-weight: 600;
  font-size: 13px;
  color: var(--text-primary);
}
.law-desc {
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 6px;
  line-height: 1.4;
}
.law-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10px;
}

/* ??? Stat Chart ??????????????????????? */
.stat-chart-container {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 4px;
}
.stat-chart-container canvas {
  display: block;
}

/* ??? Input Small ?????????????????????? */
.input-sm {
  padding: 3px 6px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 11px;
  outline: none;
  cursor: pointer;
}
.input-sm:focus {
  border-color: var(--accent-blue);
}

/* ??? Button Sizes ????????????????????? */
.btn-sm {
  padding: 3px 8px;
  font-size: 11px;
}
.btn-outline {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}
.btn-outline:hover {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

/* ??? Table cell enhancements ?????????? */
.data-table td {
  vertical-align: middle;
}

/* ??? Replication sync log ?????????????? */
#rep-log {
  max-height: 100px;
  overflow-y: auto;
}
#rep-log .log-entry {
  font-size: 10px;
}

 / *   P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%
       L i f e   P a n e l      H e a l t h ,   E n e r g y ,   B a c k u p ,   C r u i s e 
       P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%  * / 
 
 / *    % % %  H e a l t h   S t a t u s    % % % % % % % % % % % % % % % % % % % %  * / 
 . h e a l t h - s u m m a r y   { 
     d i s p l a y :   f l e x ; 
     a l i g n - i t e m s :   c e n t e r ; 
     g a p :   1 0 p x ; 
     p a d d i n g :   1 2 p x   1 6 p x ; 
     b a c k g r o u n d :   v a r ( - - b g - s e c o n d a r y ) ; 
     b o r d e r :   1 p x   s o l i d   v a r ( - - b o r d e r - c o l o r ) ; 
     b o r d e r - r a d i u s :   v a r ( - - r a d i u s ) ; 
     m a r g i n - b o t t o m :   1 2 p x ; 
 } 
 . h e a l t h - i n d i c a t o r   { 
     f o n t - s i z e :   2 8 p x ; 
     l i n e - h e i g h t :   1 ; 
 } 
 . h e a l t h - l a b e l   { 
     f o n t - s i z e :   1 8 p x ; 
     f o n t - w e i g h t :   6 0 0 ; 
 } 
 . h e a l t h - l a b e l : h a s ( +   . h e a l t h - i n d i c a t o r . h e a l t h y ) , 
 . h e a l t h - i n d i c a t o r . h e a l t h y   +   . h e a l t h - l a b e l   {   c o l o r :   v a r ( - - a c c e n t - g r e e n ) ;   } 
 . h e a l t h - i n d i c a t o r . d e g r a d e d   +   . h e a l t h - l a b e l   {   c o l o r :   v a r ( - - a c c e n t - y e l l o w ) ;   } 
 . h e a l t h - i n d i c a t o r . u n h e a l t h y   +   . h e a l t h - l a b e l   {   c o l o r :   v a r ( - - a c c e n t - r e d ) ;   } 
 
 . h e a l t h - c h e c k s   { 
     d i s p l a y :   f l e x ; 
     f l e x - d i r e c t i o n :   c o l u m n ; 
     g a p :   4 p x ; 
 } 
 . h e a l t h - c h e c k - i t e m   { 
     d i s p l a y :   f l e x ; 
     a l i g n - i t e m s :   c e n t e r ; 
     g a p :   6 p x ; 
     p a d d i n g :   5 p x   1 0 p x ; 
     b a c k g r o u n d :   v a r ( - - b g - s e c o n d a r y ) ; 
     b o r d e r :   1 p x   s o l i d   v a r ( - - b o r d e r - c o l o r ) ; 
     b o r d e r - r a d i u s :   v a r ( - - r a d i u s - s m ) ; 
     f o n t - s i z e :   1 2 p x ; 
 } 
 . h e a l t h - c h e c k - i t e m   . c h e c k - n a m e   { 
     f o n t - w e i g h t :   5 0 0 ; 
     c o l o r :   v a r ( - - t e x t - p r i m a r y ) ; 
 } 
 . h e a l t h - c h e c k - i t e m   . c h e c k - m s g   { 
     c o l o r :   v a r ( - - t e x t - s e c o n d a r y ) ; 
     f o n t - s i z e :   1 1 p x ; 
 } 
 
 / *    % % %  E n e r g y   B a r    % % % % % % % % % % % % % % % % % % % % % % %  * / 
 . e n e r g y - b a r - c o n t a i n e r   { 
     p a d d i n g :   8 p x   0 ; 
 } 
 . e n e r g y - b a r - h e a d e r   { 
     d i s p l a y :   f l e x ; 
     j u s t i f y - c o n t e n t :   s p a c e - b e t w e e n ; 
     a l i g n - i t e m s :   c e n t e r ; 
     m a r g i n - b o t t o m :   6 p x ; 
 } 
 . e n e r g y - b a r - l a b e l   { 
     f o n t - s i z e :   1 4 p x ; 
     f o n t - w e i g h t :   6 0 0 ; 
     c o l o r :   v a r ( - - t e x t - p r i m a r y ) ; 
 } 
 . e n e r g y - b a r - p c t   { 
     f o n t - s i z e :   1 3 p x ; 
     f o n t - w e i g h t :   6 0 0 ; 
     f o n t - f a m i l y :   v a r ( - - f o n t - m o n o ) ; 
     c o l o r :   v a r ( - - t e x t - s e c o n d a r y ) ; 
 } 
 . e n e r g y - b a r - t r a c k   { 
     w i d t h :   1 0 0 % ; 
     h e i g h t :   2 0 p x ; 
     b a c k g r o u n d :   v a r ( - - b g - s e c o n d a r y ) ; 
     b o r d e r :   1 p x   s o l i d   v a r ( - - b o r d e r - c o l o r ) ; 
     b o r d e r - r a d i u s :   1 0 p x ; 
     o v e r f l o w :   h i d d e n ; 
 } 
 . e n e r g y - b a r - f i l l   { 
     h e i g h t :   1 0 0 % ; 
     b o r d e r - r a d i u s :   1 0 p x ; 
     t r a n s i t i o n :   w i d t h   0 . 5 s   e a s e ,   b a c k g r o u n d   0 . 5 s   e a s e ; 
     m i n - w i d t h :   4 p x ; 
 } 
 
 / *    % % %  T o k e n   U s a g e    % % % % % % % % % % % % % % % % % % % % % %  * / 
 . t o k e n - u s a g e   { 
     m a r g i n - t o p :   1 0 p x ; 
     p a d d i n g :   8 p x   1 2 p x ; 
     b a c k g r o u n d :   v a r ( - - b g - s e c o n d a r y ) ; 
     b o r d e r :   1 p x   s o l i d   v a r ( - - b o r d e r - c o l o r ) ; 
     b o r d e r - r a d i u s :   v a r ( - - r a d i u s - s m ) ; 
 } 
 . t o k e n - r o w   { 
     d i s p l a y :   f l e x ; 
     j u s t i f y - c o n t e n t :   s p a c e - b e t w e e n ; 
     f o n t - s i z e :   1 2 p x ; 
     p a d d i n g :   2 p x   0 ; 
     c o l o r :   v a r ( - - t e x t - s e c o n d a r y ) ; 
 } 
 . t o k e n - r o w   s p a n : l a s t - c h i l d   { 
     f o n t - f a m i l y :   v a r ( - - f o n t - m o n o ) ; 
     c o l o r :   v a r ( - - t e x t - p r i m a r y ) ; 
 } 
 
 / *    % % %  E c o   T o g g l e    % % % % % % % % % % % % % % % % % % % % % % %  * / 
 . e c o - t o g g l e - r o w   { 
     m a r g i n - t o p :   1 0 p x ; 
     p a d d i n g :   6 p x   0 ; 
 } 
 . t o g g l e - l a b e l   { 
     d i s p l a y :   f l e x ; 
     a l i g n - i t e m s :   c e n t e r ; 
     g a p :   8 p x ; 
     c u r s o r :   p o i n t e r ; 
     f o n t - s i z e :   1 3 p x ; 
     c o l o r :   v a r ( - - t e x t - s e c o n d a r y ) ; 
     u s e r - s e l e c t :   n o n e ; 
 } 
 . t o g g l e - l a b e l   i n p u t [ t y p e = " c h e c k b o x " ]   { 
     d i s p l a y :   n o n e ; 
 } 
 . t o g g l e - s l i d e r   { 
     p o s i t i o n :   r e l a t i v e ; 
     w i d t h :   3 6 p x ; 
     h e i g h t :   2 0 p x ; 
     b a c k g r o u n d :   v a r ( - - b g - i n p u t ) ; 
     b o r d e r :   1 p x   s o l i d   v a r ( - - b o r d e r - c o l o r ) ; 
     b o r d e r - r a d i u s :   1 0 p x ; 
     t r a n s i t i o n :   v a r ( - - t r a n s i t i o n ) ; 
     f l e x - s h r i n k :   0 ; 
 } 
 . t o g g l e - s l i d e r : : a f t e r   { 
     c o n t e n t :   " " ; 
     p o s i t i o n :   a b s o l u t e ; 
     t o p :   2 p x ; 
     l e f t :   2 p x ; 
     w i d t h :   1 4 p x ; 
     h e i g h t :   1 4 p x ; 
     b a c k g r o u n d :   v a r ( - - t e x t - m u t e d ) ; 
     b o r d e r - r a d i u s :   5 0 % ; 
     t r a n s i t i o n :   v a r ( - - t r a n s i t i o n ) ; 
 } 
 . t o g g l e - l a b e l   i n p u t : c h e c k e d   +   . t o g g l e - s l i d e r   { 
     b a c k g r o u n d :   r g b a ( 4 6 , 2 0 4 , 1 1 3 , 0 . 3 ) ; 
     b o r d e r - c o l o r :   v a r ( - - a c c e n t - g r e e n ) ; 
 } 
 . t o g g l e - l a b e l   i n p u t : c h e c k e d   +   . t o g g l e - s l i d e r : : a f t e r   { 
     l e f t :   1 8 p x ; 
     b a c k g r o u n d :   v a r ( - - a c c e n t - g r e e n ) ; 
 } 
 
 / *    % % %  H e a l t h   G a u g e    % % % % % % % % % % % % % % % % % % % % %  * / 
 . g a u g e - c o n t a i n e r   { 
     d i s p l a y :   f l e x ; 
     f l e x - d i r e c t i o n :   c o l u m n ; 
     a l i g n - i t e m s :   c e n t e r ; 
     g a p :   2 p x ; 
 } 
 . g a u g e - v a l u e   { 
     f o n t - s i z e :   1 6 p x ; 
     f o n t - w e i g h t :   7 0 0 ; 
     f o n t - f a m i l y :   v a r ( - - f o n t - m o n o ) ; 
 } 
 . g a u g e - l a b e l   { 
     f o n t - s i z e :   9 p x ; 
     c o l o r :   v a r ( - - t e x t - m u t e d ) ; 
     t e x t - t r a n s f o r m :   u p p e r c a s e ; 
 } 
 . g a u g e - t r a c k   { 
     w i d t h :   6 0 p x ; 
     h e i g h t :   4 p x ; 
     b a c k g r o u n d :   v a r ( - - b g - s e c o n d a r y ) ; 
     b o r d e r - r a d i u s :   2 p x ; 
     o v e r f l o w :   h i d d e n ; 
 } 
 . g a u g e - f i l l   { 
     h e i g h t :   1 0 0 % ; 
     b o r d e r - r a d i u s :   2 p x ; 
     t r a n s i t i o n :   w i d t h   0 . 5 s   e a s e ; 
 } 
 
 / *    % % %  B a c k u p   T a b l e    % % % % % % % % % % % % % % % % % % % % %  * / 
 . b a c k u p - t a b l e   t h : f i r s t - c h i l d   {   m i n - w i d t h :   9 0 p x ;   } 
 . b a c k u p - t a b l e   t h : n t h - c h i l d ( 2 )   {   m i n - w i d t h :   8 0 p x ;   } 
 . b a c k u p - t a b l e   t h : n t h - c h i l d ( 3 )   {   m i n - w i d t h :   5 0 p x ;   } 
 . b a c k u p - t a b l e   t h : n t h - c h i l d ( 4 )   {   m i n - w i d t h :   6 0 p x ;   } 
 . b a c k u p - t a b l e   t h : n t h - c h i l d ( 5 )   {   m i n - w i d t h :   6 0 p x ;   } 
 
 / *    % % %  C r u i s e   L o g   T a b l e    % % % % % % % % % % % % % % % % %  * / 
 . c r u i s e - t a b l e   t h : f i r s t - c h i l d   {   m i n - w i d t h :   9 0 p x ;   } 
 . c r u i s e - t a b l e   t h : n t h - c h i l d ( 2 )   {   m i n - w i d t h :   6 0 p x ;   } 
 . c r u i s e - t a b l e   t h : l a s t - c h i l d   {   w i d t h :   1 0 0 % ;   } 
 
 / *    % % %  L i f e   P a n e l   G r i d   ( 2 x 2 )    % % % % % % % % % % % %  * / 
 # p a n e l - l i f e . p a n e l - g r i d   { 
     g r i d - t e m p l a t e - c o l u m n s :   1 f r   1 f r ; 
     g r i d - t e m p l a t e - r o w s :   1 f r   1 f r ; 
 }  
 
/* ─── Perception Panel ─────────────────────────────────────── */
.perception-panel { }

.sense-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.sense-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  transition: var(--transition);
}
.sense-card:hover {
  border-color: var(--border-hover);
}
.sense-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 12px;
}
.sense-card.error-card {
  border-color: rgba(231,76,60,0.3);
  background: rgba(231,76,60,0.05);
}

/* ─── Meter Gauge (SVG ring) ───────────────────────────────── */
.meter-gauge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.meter-gauge-label {
  font-size: 11px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.meter-value {
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-mono);
}

/* ─── OCR Text Display ─────────────────────────────────────── */
.ocr-text {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.5;
  color: var(--text-primary);
  max-height: 150px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

/* ─── Audio Wave Animation ─────────────────────────────────── */
.audio-wave {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 8px 0;
  justify-content: center;
}
.wave-bar {
  width: 3px;
  height: 16px;
  background: var(--accent-cyan);
  border-radius: 2px;
  animation: wave-anim 0.8s ease-in-out infinite alternate;
}
@keyframes wave-anim {
  0%   { height: 6px; opacity: 0.4; }
  100% { height: 24px; opacity: 1; }
}

/* ─── Capture History Items ────────────────────────────────── */
.history-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 0;
  font-size: 11px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);
}
.history-item:last-child {
  border-bottom: none;
}
.history-item:hover {
  color: var(--text-primary);
}

/* ─── Perception Status Dots ───────────────────────────────── */
#perception-screen-status.text-success,
#perception-audio-status.text-success,
#perception-env-status.text-success {
  position: relative;
}
#perception-screen-status.text-success::before,
#perception-audio-status.text-success::before,
#perception-env-status.text-success::before {
  content: "●";
  margin-right: 4px;
  font-size: 10px;
}


/* ─── Social Panel ─────────────────────────────────────────── */
#panel-social.panel-grid {
  grid-template-columns: 1fr 1fr;
}

.conflict-card {
  background: var(--bg-secondary);
  border: 1px solid var(--accent-orange);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 8px;
}

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

.conflict-body {
  font-size: 12px;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.conflict-actions {
  display: flex;
  gap: 6px;
}

.conflict-card .btn-success {
  background: rgba(46, 204, 113, 0.2);
  border-color: var(--accent-green);
  color: var(--accent-green);
}

.conflict-card .btn-info {
  background: rgba(74, 138, 255, 0.2);
  border-color: var(--accent-blue);
  color: var(--accent-blue);
}

.invite-code {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 14px;
}

.invite-code code {
  font-size: 14px;
  letter-spacing: 1px;
  color: var(--accent-cyan);
}

/* ─── Topology SVG ─────────────────────────────────────────── */
#soc-topology svg {
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

/* ─── Data Table within Social ─────────────────────────────── */
#soc-peer-table .data-table,
#soc-domain-clocks .data-table,
#soc-sync-log .data-table {
  font-size: 11px;
}

#soc-peer-table .data-table th,
#soc-domain-clocks .data-table th,
#soc-sync-log .data-table th {
  font-size: 10px;
}

/* ─── Input group for invite ───────────────────────────────── */
#soc-invite-input:focus {
  outline: none;
  border-color: var(--accent-blue);
}


/* ??? Voice Panel Styles ???????????????????????????????????? */
.voice-controls {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.voice-select {
  background: #16213e;
  color: #e0e0e0;
  border: 1px solid #2a3a5e;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 13px;
  flex: 1;
  min-width: 140px;
}

.voice-textarea {
  width: 100%;
  background: #16213e;
  color: #e0e0e0;
  border: 1px solid #2a3a5e;
  border-radius: 6px;
  padding: 10px;
  font-size: 13px;
  resize: vertical;
  box-sizing: border-box;
}

.voice-textarea:focus {
  outline: none;
  border-color: #00d4ff;
}

.voice-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.btn-record {
  background: #e63946;
  color: white;
  border: none;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-record:hover {
  background: #d62839;
  transform: scale(1.05);
}

.btn-record.recording {
  background: #d62839;
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(230, 57, 70, 0.7); }
  70% { box-shadow: 0 0 0 12px rgba(230, 57, 70, 0); }
  100% { box-shadow: 0 0 0 0 rgba(230, 57, 70, 0); }
}

.voice-waveform {
  width: 100%;
  height: 100px;
  border-radius: 6px;
  margin: 8px 0;
  background: #1a1a2e;
}

.voice-log {
  max-height: 200px;
  overflow-y: auto;
  font-size: 12px;
  line-height: 1.5;
}

.log-entry {
  padding: 4px 8px;
  border-radius: 4px;
  margin-bottom: 2px;
}

.log-info { color: #a0c4ff; background: rgba(160, 196, 255, 0.1); }
.log-success { color: #95d5b2; background: rgba(149, 213, 178, 0.1); }
.log-error { color: #ff8a8a; background: rgba(255, 138, 138, 0.1); }
.log-warning { color: #ffd166; background: rgba(255, 209, 102, 0.1); }

.log-time {
  color: #666;
  margin-right: 8px;
  font-family: monospace;
}

.engine-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
}

.engine-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.engine-dot.online { background: #95d5b2; box-shadow: 0 0 4px #95d5b2; }
.engine-dot.offline { background: #ff8a8a; box-shadow: 0 0 4px #ff8a8a; }

.engine-name {
  font-size: 13px;
  color: #e0e0e0;
  text-transform: capitalize;
}

/* ─── Phase 19-02: Reaction Rules Panel ────────────────────── */

.reaction-rule-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 6px;
  transition: border-color 0.2s;
}
.reaction-rule-card:hover {
  border-color: var(--border-hover);
}

.rule-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}
.rule-name {
  font-weight: 600;
  font-size: 13px;
  color: var(--text-primary);
}
.rule-badge {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 8px;
  font-weight: 600;
}
.badge-enabled {
  background: rgba(46, 204, 113, 0.2);
  color: var(--accent-green);
}
.badge-disabled {
  background: rgba(85, 85, 122, 0.3);
  color: var(--text-muted);
}

.rule-detail {
  font-size: 11px;
  color: var(--text-secondary);
  margin: 2px 0;
}
.rule-detail code {
  background: var(--bg-secondary);
  padding: 1px 4px;
  border-radius: 3px;
  font-size: 10px;
}

.rule-actions {
  display: flex;
  gap: 4px;
  margin-top: 6px;
}

/* Log rows */
.reaction-log-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 8px;
  border-bottom: 1px solid var(--border-color);
  font-size: 12px;
}
.reaction-log-row:last-child {
  border-bottom: none;
}
.log-event {
  font-weight: 600;
  color: var(--accent-cyan);
  min-width: 100px;
  font-size: 11px;
}
.log-rule {
  color: var(--accent-yellow);
  min-width: 120px;
  font-size: 11px;
}
.log-actions {
  flex: 1;
  color: var(--text-secondary);
  font-size: 11px;
}
.log-time {
  color: var(--text-muted);
  font-size: 10px;
  white-space: nowrap;
  min-width: 60px;
  text-align: right;
}

.form-group {
  margin-bottom: 8px;
}
.form-group label {
  display: block;
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 3px;
}
.form-input {
  width: 100%;
  padding: 6px 8px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 12px;
  font-family: var(--font-mono);
  box-sizing: border-box;
}
.form-input:focus {
  outline: none;
  border-color: var(--accent-blue);
}
textarea.form-input {
  resize: vertical;
  min-height: 40px;
}
select.form-input {
  cursor: pointer;
}
.btn-xs {
  font-size: 10px;
  padding: 2px 8px;
}
.btn-danger {
  background: rgba(231, 76, 60, 0.2);
  color: #e74c3c;
  border: 1px solid rgba(231, 76, 60, 0.3);
}
.btn-danger:hover {
  background: rgba(231, 76, 60, 0.4);
}


.panel-btn{display:block;width:100%;padding:10px 14px;background:var(--bg-card);border:1px solid var(--border-color);color:var(--text-primary);border-radius:var(--radius-sm);cursor:pointer;text-align:left;font-size:13px;font-family:inherit;transition:all 0.2s}
.panel-btn:hover{background:var(--bg-card-hover);border-color:var(--border-hover)}
