/* ==========================================================================
   God Father Enterprise Design System
   Professional, corporate monitoring UI (Non-vibe coded)
   ========================================================================== */

:root {
  --bg-app: #080c14;
  --bg-sidebar: #0d121f;
  --bg-card: #111728;
  --bg-card-hover: #161e33;
  --bg-input: #0a0e1a;
  --bg-panel: #0f1524;

  --border-subtle: #1c263c;
  --border-focus: #3b82f6;
  --border-divider: #182033;

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --color-brand: #2563eb;
  --color-brand-hover: #1d4ed8;

  --color-success: #10b981;
  --color-success-bg: rgba(16, 185, 129, 0.1);
  --color-success-border: rgba(16, 185, 129, 0.25);

  --color-warning: #f59e0b;
  --color-warning-bg: rgba(245, 158, 11, 0.1);
  --color-warning-border: rgba(245, 158, 11, 0.25);

  --color-danger: #ef4444;
  --color-danger-bg: rgba(239, 68, 68, 0.1);
  --color-danger-border: rgba(239, 68, 68, 0.25);

  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
}

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

body.enterprise-app {
  font-family: var(--font-sans);
  background-color: var(--bg-app);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ==========================================================================
   Layout: Sidebar + Main Workspace
   ========================================================================== */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.app-sidebar {
  width: 250px;
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
}

.sidebar-brand {
  height: 56px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.brand-badge {
  width: 28px;
  height: 28px;
  background: var(--color-brand);
  color: #fff;
  font-weight: 800;
  font-size: 0.8rem;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.02em;
}

.brand-text h2 {
  font-size: 0.88rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.01em;
}

.brand-text span {
  font-size: 0.7rem;
  color: var(--text-muted);
  display: block;
  line-height: 1;
}

.sidebar-nav {
  padding: 16px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  overflow-y: auto;
}

.nav-section-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  padding: 12px 10px 4px;
  text-transform: uppercase;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}

.sidebar-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.04);
}

.sidebar-link.active {
  color: #fff;
  background: #182238;
  border-left: 2px solid var(--color-brand);
}

.service-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dot-online {
  background: var(--color-success);
  box-shadow: 0 0 4px var(--color-success);
}

.dot-sync {
  background: var(--color-warning);
}

.dot-error {
  background: var(--color-danger);
}

.dot-idle {
  background: var(--text-muted);
}

.sidebar-link.add-link {
  color: var(--text-muted);
  border: 1px dashed var(--border-subtle);
  margin-top: 6px;
  justify-content: center;
  font-size: 0.78rem;
}

.sidebar-link.add-link:hover {
  border-color: var(--color-brand);
  color: #fff;
  background: rgba(37, 99, 235, 0.06);
}

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.72rem;
  color: var(--text-muted);
}

.gateway-status {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.status-dot.online {
  background: var(--color-success);
  box-shadow: 0 0 6px var(--color-success);
}

/* Main Workspace */
.app-main {
  margin-left: 250px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Top Nav Bar */
.top-nav-bar {
  height: 56px;
  padding: 0 24px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-app);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 50;
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
}

.crumb-root {
  color: var(--text-muted);
  font-weight: 500;
}

.crumb-sep {
  color: var(--border-subtle);
}

.crumb-current {
  color: #fff;
  font-weight: 600;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.token-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  font-size: 0.76rem;
  font-weight: 600;
  border-radius: 9999px;
  border: 1px solid;
}

.token-badge .badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.badge-active {
  background: var(--color-success-bg);
  border-color: var(--color-success-border);
  color: #34d399;
}

.badge-active .badge-dot {
  background: var(--color-success);
  box-shadow: 0 0 4px var(--color-success);
}

.badge-warning {
  background: var(--color-warning-bg);
  border-color: var(--color-warning-border);
  color: #fbbf24;
}

.badge-warning .badge-dot {
  background: var(--color-warning);
}

.badge-sync {
  background: rgba(37, 99, 235, 0.1);
  border-color: rgba(37, 99, 235, 0.3);
  color: #60a5fa;
}

.badge-error {
  background: var(--color-danger-bg);
  border-color: var(--color-danger-border);
  color: #f87171;
}

.badge-idle {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border-subtle);
  color: var(--text-muted);
}

/* ==========================================================================
   Buttons & Inputs
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  font-family: var(--font-sans);
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  text-decoration: none;
  white-space: nowrap;
}

.btn-sm {
  padding: 5px 10px;
  font-size: 0.76rem;
}

.btn-primary {
  background: var(--color-brand);
  color: #fff;
}

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

.btn-secondary {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border-subtle);
  color: var(--text-secondary);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.15);
}

.btn-text {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.76rem;
  padding: 4px 6px;
  border-radius: var(--radius-xs);
  transition: color 0.15s ease;
}

.btn-text:hover {
  color: #f87171;
}

.btn-icon {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  border-radius: var(--radius-xs);
  padding: 4px 8px;
  cursor: pointer;
  font-size: 0.76rem;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-icon:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-icon.copied {
  color: var(--color-success);
  border-color: var(--color-success);
}

.clean-select,
.clean-input {
  width: 100%;
  box-sizing: border-box;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: #fff;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.15s ease;
}

.clean-select:focus,
.clean-input:focus,
.code-input:focus {
  border-color: var(--border-focus);
}

.password-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.password-input-wrap .clean-input,
.password-input-wrap input {
  width: 100% !important;
  box-sizing: border-box;
  padding-right: 42px;
}

.full-width {
  width: 100%;
}

/* ==========================================================================
   Workspace Body
   ========================================================================== */
.workspace-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  flex: 1;
}

.service-header-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px 20px;
}

.service-identity h1 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
}

.service-identity p {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.feed-controls-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.endpoint-picker {
  display: flex;
  align-items: center;
  gap: 8px;
}

.endpoint-picker label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
}

.sync-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* KPI Highlights Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.kpi-widget {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.kpi-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.kpi-value {
  font-size: 1.3rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: #fff;
}

/* Main Content Panel */
.content-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.panel-tabs {
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border-subtle);
  background: #0a0e19;
  padding: 0 8px;
}

.tab-item {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 12px 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-bottom: 2px solid transparent;
  transition: all 0.15s ease;
}

.tab-item:hover {
  color: #fff;
}

.tab-item.active {
  color: #fff;
  border-bottom-color: var(--color-brand);
}

.tab-pill {
  font-size: 0.7rem;
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: 9999px;
}

.panel-meta {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding-right: 8px;
}

#lastSyncedLabel {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.tab-pane {
  display: none;
  min-height: 360px;
}

.tab-pane.active {
  display: block;
}

/* Table View */
.table-container {
  overflow-x: auto;
  max-height: 520px;
}

.clean-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.82rem;
}

.clean-table th {
  background: #0c101c;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 10;
}

.clean-table td {
  padding: 10px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.clean-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.badge-status {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 9999px;
  display: inline-block;
}

.status-success {
  background: var(--color-success-bg);
  color: #34d399;
}

.status-warning {
  background: var(--color-warning-bg);
  color: #fbbf24;
}

.status-error {
  background: var(--color-danger-bg);
  color: #f87171;
}

.status-idle {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
}

/* Property Grid */
.property-grid {
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 10px;
}

.prop-item {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.prop-key {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
}

.prop-val {
  font-size: 0.84rem;
  font-family: var(--font-mono);
  color: #fff;
  font-weight: 600;
}

/* Raw JSON Viewer */
.json-viewer {
  margin: 0;
  padding: 16px 20px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.6;
  max-height: 520px;
  overflow: auto;
  background: #080c14;
  color: #cbd5e1;
}

.json-key {
  color: #38bdf8;
}

.json-string {
  color: #34d399;
}

.json-number {
  color: #f59e0b;
}

.json-boolean {
  color: #a78bfa;
  font-weight: 600;
}

.json-null {
  color: #ef4444;
}

/* Telemetry Table */
.telemetry-table-wrapper {
  padding: 16px;
}

.telemetry-table-wrapper .cell-key {
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  width: 30%;
}

.telemetry-table-wrapper .cell-val {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: #fff;
}

.empty-placeholder {
  color: var(--text-muted);
  font-size: 0.84rem;
  text-align: center;
  padding: 48px 16px;
}

.error-panel {
  padding: 24px;
  background: var(--color-danger-bg);
  border: 1px solid var(--color-danger-border);
  border-radius: var(--radius-md);
  margin: 16px;
}

.error-panel h4 {
  color: #f87171;
  font-size: 0.92rem;
  margin-bottom: 4px;
}

.error-panel p {
  color: var(--text-secondary);
  font-size: 0.82rem;
}

/* ==========================================================================
   Page: Service Credentials (/creds)
   ========================================================================== */
.page-title-card h1 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
}

.page-title-card p {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.creds-two-column {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

@media (max-width: 1100px) {
  .creds-two-column {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

.card-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

@media (max-width: 640px) {
  .card-panel {
    padding: 16px 14px;
  }
}

.card-header h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  word-break: break-word;
}

.clean-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

.form-field label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
}

.form-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

@media (max-width: 640px) {
  .form-row {
    flex-direction: column;
    gap: 10px;
  }
}

.flex-1 {
  flex: 1 1 140px;
  min-width: 0;
}

.flex-2 {
  flex: 2 1 240px;
  min-width: 0;
}

.flex-3 {
  flex: 3 1 300px;
  min-width: 0;
}

.code-input {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: #cbd5e1;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  outline: none;
  resize: vertical;
}

.help-text {
  font-size: 0.7rem;
  color: var(--text-muted);
  line-height: 1.4;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.help-text code {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  word-break: break-all;
  overflow-wrap: anywhere;
}

.form-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

.form-actions .btn {
  white-space: normal;
  text-align: center;
  line-height: 1.35;
}

.form-actions .btn-dash-link {
  margin-left: auto;
}

@media (max-width: 640px) {
  .form-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .form-actions .btn,
  .form-actions .btn-dash-link {
    margin-left: 0;
    width: 100%;
    justify-content: center;
    box-sizing: border-box;
  }
}

/* Service Cards in Creds View */
.services-list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: 14px;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

.service-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.service-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.service-card-head > div {
  min-width: 0;
  flex: 1 1 120px;
}

.service-card-head h4 {
  font-size: 0.92rem;
  font-weight: 700;
  color: #fff;
  word-break: break-word;
}

.slug-badge {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  display: block;
  word-break: break-all;
}

.service-desc-text {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.card-detail-rows {
  background: #080c14;
  border-radius: var(--radius-xs);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.74rem;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.dt-key {
  color: var(--text-muted);
}

.dt-val {
  color: #cbd5e1;
  font-family: var(--font-mono);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 140px;
}

.card-action-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
  padding-top: 6px;
  border-top: 1px solid var(--border-divider);
}

/* Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-app);
}

::-webkit-scrollbar-thumb {
  background: #26334d;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #374768;
}

/* Notice Banners & Live Telemetry Alerts */
.service-notice-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 18px;
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  border: 1px solid var(--border-subtle);
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  margin-bottom: 12px;
  width: 100%;
  box-sizing: border-box;
  min-width: 0;
  transition: all 0.2s ease;
}

.service-notice-banner .banner-content {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 320px;
  min-width: 0;
  line-height: 1.5;
  word-break: break-word;
}

.service-notice-banner .banner-icon {
  font-size: 1.1rem;
  line-height: 1;
  flex-shrink: 0;
}

.service-notice-banner .banner-text {
  flex: 1;
  min-width: 0;
}

.service-notice-banner .banner-inline-link {
  font-weight: 700;
  text-decoration: underline;
  color: inherit;
  transition: opacity 0.15s ease;
}

.service-notice-banner .banner-inline-link:hover {
  opacity: 0.8;
}

.service-notice-banner code {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.25);
  word-break: break-all;
}

.service-notice-banner .banner-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.service-notice-banner .banner-meta {
  font-size: 0.74rem;
  opacity: 0.85;
  white-space: nowrap;
}

/* Default Dark Theme Banner Variants */
.service-notice-banner.banner-warning {
  border-color: rgba(245, 158, 11, 0.45);
  background: rgba(245, 158, 11, 0.12);
  color: #fde68a;
}

.service-notice-banner.banner-warning strong {
  color: #fbbf24;
}

.service-notice-banner.banner-warning .btn-secondary {
  background: rgba(245, 158, 11, 0.18);
  border-color: rgba(245, 158, 11, 0.5);
  color: #fde68a;
}

.service-notice-banner.banner-warning .btn-secondary:hover {
  background: rgba(245, 158, 11, 0.3);
  color: #ffffff;
}

.service-notice-banner.banner-error {
  border-color: rgba(239, 68, 68, 0.45);
  background: rgba(239, 68, 68, 0.12);
  color: #fca5a5;
}

.service-notice-banner.banner-error strong {
  color: #f87171;
}

.service-notice-banner.banner-error .btn-secondary {
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(239, 68, 68, 0.5);
  color: #fca5a5;
}

.service-notice-banner.banner-error .btn-secondary:hover {
  background: rgba(239, 68, 68, 0.3);
  color: #ffffff;
}

.service-notice-banner.banner-success {
  border-color: rgba(16, 185, 129, 0.45);
  background: rgba(16, 185, 129, 0.12);
  color: #a7f3d0;
}

.service-notice-banner.banner-success strong {
  color: #34d399;
}

.service-notice-banner.banner-info {
  border-color: rgba(59, 130, 246, 0.45);
  background: rgba(59, 130, 246, 0.12);
  color: #bfdbfe;
}

.service-notice-banner.banner-info strong {
  color: #60a5fa;
}

/* ==========================================================================
   VRAM Estates Specialized Dashboard Styling
   ========================================================================== */
.vram-dashboard-layout {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px;
}

.vram-section-card {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.vram-card-head {
  padding: 12px 16px;
  background: #0b0f1c;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.vram-card-head h4 {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

/* Lead Pipeline Funnel Bar */
.lead-pipeline-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  overflow-x: auto;
  gap: 8px;
}

.pipeline-stage {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.stage-name {
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.stage-badge {
  font-size: 0.76rem;
  font-weight: 700;
  font-family: var(--font-mono);
  background: rgba(255, 255, 255, 0.08);
  padding: 1px 7px;
  border-radius: 9999px;
  color: #fff;
}

.stage-new {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
}

.stage-interested {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
}

.stage-booked {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
}

.pipeline-sep {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Source badge & Price tag */
.badge-source {
  font-size: 0.7rem;
  font-family: var(--font-mono);
  padding: 2px 7px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  color: #94a3b8;
}

.price-tag {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  color: #34d399;
}

/* Two-column Split */
.vram-split-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 900px) {
  .vram-split-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Elite Maverick Dashboard Styling
   ========================================================================== */
.system-health-bar {
  display: flex;
  align-items: center;
  gap: 20px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 18px;
  font-size: 0.78rem;
  overflow-x: auto;
}

.health-item {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.health-key {
  color: var(--text-muted);
  font-weight: 600;
}

.health-val {
  color: #fff;
  font-weight: 700;
}

.health-val.healthy {
  color: #34d399;
}

.health-divider {
  width: 1px;
  height: 18px;
  background: var(--border-subtle);
}

/* Activity Feed */
.activity-feed-list {
  display: flex;
  flex-direction: column;
  max-height: 480px;
  overflow-y: auto;
  divide-y: 1px solid rgba(255, 255, 255, 0.04);
}

.activity-feed-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  transition: background var(--transition-fast);
}

.activity-feed-item:hover {
  background: rgba(255, 255, 255, 0.02);
}

.activity-icon-badge {
  font-size: 1.1rem;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.activity-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.activity-desc {
  font-size: 0.82rem;
  color: #f1f5f9;
  font-weight: 500;
  word-break: break-word;
}

.activity-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.activity-actor {
  color: #60a5fa;
  font-weight: 600;
}

.activity-time {
  font-family: var(--font-mono);
}

/* User Activity Bar Chart */
.activity-chart-wrapper {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chart-bars-row {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 120px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-subtle);
}

.chart-bar-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
  position: relative;
}

.chart-bar-fill {
  width: 100%;
  max-width: 14px;
  background: #3b82f6;
  border-radius: 2px 2px 0 0;
  transition: height 0.3s ease;
  min-height: 2px;
}

.chart-bar-fill.signup-bar {
  background: #10b981;
}

.chart-bar-group:hover .chart-bar-fill {
  filter: brightness(1.25);
}

.chart-legend {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.74rem;
  color: var(--text-muted);
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  display: inline-block;
  margin-right: 4px;
}

.legend-dot.dau {
  background: #3b82f6;
}

.legend-dot.signups {
  background: #10b981;
}

/* ==========================================================================
   Comprehensive Responsive Layout & Mobile Drawer System
   ========================================================================== */

/* Mobile Sidebar Toggle Button (inside top-nav-bar) */
.mobile-sidebar-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-xs);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: #fff;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.mobile-sidebar-toggle:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.25);
}

/* Mobile Sidebar Close Button (inside sidebar-brand) */
.mobile-sidebar-close {
  display: none;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-xs);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.mobile-sidebar-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

/* Sidebar Backdrop */
.sidebar-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(5, 8, 15, 0.72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 998;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.sidebar-backdrop.visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Nav Left Group */
.nav-left-group {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

/* Table Containers */
.table-container,
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-xs);
}

.clean-table,
.data-table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
}

/* Card Grid Split */
.card-grid-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 18px;
}

.card-grid-split.bottom-split {
  grid-template-columns: 1.15fr 0.85fr;
  align-items: start;
}

/* Breakpoint: <= 1024px */
@media (max-width: 1024px) {
  .app-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: 270px;
    z-index: 999;
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.28s ease, visibility 0.28s ease;
    box-shadow: none;
    visibility: hidden;
    pointer-events: none;
  }

  .app-sidebar.open {
    transform: translateX(0);
    box-shadow: 6px 0 32px rgba(0, 0, 0, 0.65);
    visibility: visible;
    pointer-events: auto;
  }

  .app-main {
    margin-left: 0 !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  body.sidebar-active {
    overflow: hidden;
  }

  .mobile-sidebar-toggle {
    display: inline-flex;
  }

  .mobile-sidebar-close {
    display: inline-flex;
  }

  .card-grid-split,
  .card-grid-split.bottom-split,
  .vram-split-grid {
    grid-template-columns: 1fr !important;
    gap: 16px;
  }
}

/* Breakpoint: <= 768px */
@media (max-width: 768px) {
  .top-nav-bar {
    height: auto;
    min-height: 54px;
    padding: 10px 14px;
    gap: 10px;
    flex-wrap: wrap;
  }

  .breadcrumbs {
    font-size: 0.78rem;
  }

  .top-actions {
    flex-wrap: wrap;
    gap: 8px;
    margin-left: auto;
  }

  .token-badge {
    font-size: 0.72rem;
    padding: 4px 10px;
  }

  .workspace-body {
    padding: 14px 12px;
    gap: 14px;
  }

  .service-header-card {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    padding: 14px;
  }

  .service-hero-banner {
    padding: 16px 14px;
  }

  .service-notice-banner {
    flex-direction: column;
    align-items: stretch;
    padding: 12px 14px;
    gap: 12px;
  }

  .service-notice-banner .banner-content {
    flex: 1 1 auto;
    width: 100%;
  }

  .service-notice-banner .banner-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .service-notice-banner .banner-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .feed-controls-row {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 10px;
  }

  .endpoint-picker {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 6px;
  }

  .sync-controls {
    width: 100%;
    justify-content: space-between;
    gap: 8px;
  }

  .sync-controls .clean-select {
    flex: 1;
    min-width: 0;
  }

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

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

  .kpi-widget {
    padding: 12px 14px;
  }

  .kpi-value {
    font-size: 1.35rem;
  }

  .lead-pipeline-bar {
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    padding: 12px 10px;
  }

  .pipeline-sep {
    display: none;
  }

  .pipeline-stage {
    flex: 1 1 calc(50% - 8px);
    min-width: 120px;
    justify-content: space-between;
  }

  .system-health-bar {
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px 12px;
  }

  .health-divider {
    display: none;
  }

  .health-item {
    flex: 1 1 calc(50% - 10px);
    min-width: 120px;
  }

  .mentions-filter-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .mentions-filter-bar > div {
    width: 100% !important;
    margin-left: 0 !important;
  }

  .mentions-filter-bar select,
  .mentions-filter-bar input {
    width: 100% !important;
  }

  .form-row {
    flex-direction: column;
    gap: 10px;
  }
}

/* Breakpoint: <= 480px */
@media (max-width: 480px) {
  .top-nav-bar {
    padding: 8px 10px;
  }

  .breadcrumbs .crumb-root,
  .breadcrumbs .crumb-sep {
    display: none;
  }

  .top-actions {
    width: 100%;
    justify-content: space-between;
    gap: 6px;
  }

  .top-actions .btn {
    flex: 1;
    justify-content: center;
    font-size: 0.72rem;
    padding: 5px 8px;
  }

  .workspace-body {
    padding: 10px 8px;
    gap: 10px;
  }

  .service-header-card {
    padding: 12px;
  }

  .service-identity h1 {
    font-size: 1.1rem;
  }

  .service-identity p {
    font-size: 0.76rem;
  }

  .kpi-grid {
    grid-template-columns: 1fr !important;
  }

  .kpi-cards-grid {
    grid-template-columns: 1fr !important;
  }

  .pipeline-stage {
    flex: 1 1 100%;
  }

  .health-item {
    flex: 1 1 100%;
  }

  .card-panel,
  .vram-section-card {
    padding: 12px 10px;
  }

  .mention-card-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .mention-footer-meta {
    gap: 8px;
    font-size: 0.68rem;
  }
}