/* TonySMC AI Operational Control Dashboard Stylesheet */
:root {
  --bg-primary: #0b0e14;
  --bg-surface: #151b26;
  --bg-surface-elevated: #1b2332;
  --bg-surface-hover: #222c3e;
  --border-subtle: #232d3f;
  --border-focus: #35445d;
  
  --text-primary: #eaecef;
  --text-secondary: #848e9c;
  --text-muted: #5e6673;
  --text-highlight: #ffffff;
  
  --color-accent: #f3ba2f;       /* Binance Yellow */
  --color-accent-hover: #ffcc4d;
  --color-success: #00d084;      /* Green */
  --color-warning: #ffa000;      /* Amber */
  --color-danger: #ff4d4d;       /* Red */
  --color-info: #0070f3;         /* Blue */
  --color-purple: #9b51e0;
  
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", Consolas, "Courier New", monospace;
  
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 10px;
  --radius-pill: 9999px;
  
  --shadow-card: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-modal: 0 8px 32px rgba(0, 0, 0, 0.7);
  
  --header-height: 60px;
  --sidebar-width: 240px;
}

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

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Header */
.app-header {
  height: var(--header-height);
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--color-accent), #f08c00);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #0b0e14;
  font-size: 16px;
  letter-spacing: -1px;
}

.brand-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-highlight);
  letter-spacing: 0.2px;
}

.brand-subtitle {
  font-size: 11px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.header-status {
  display: flex;
  align-items: center;
  gap: 20px;
}

.live-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--color-success);
  box-shadow: 0 0 8px var(--color-success);
}

.status-dot.pulsing {
  animation: pulse-glow 2s infinite;
}

.status-dot.degraded {
  background-color: var(--color-warning);
  box-shadow: 0 0 8px var(--color-warning);
}

.status-dot.offline {
  background-color: var(--color-danger);
  box-shadow: 0 0 8px var(--color-danger);
}

@keyframes pulse-glow {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* App Container */
.app-container {
  display: flex;
  flex: 1;
  min-height: calc(100vh - var(--header-height));
}

/* Sidebar Navigation */
.app-sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-surface);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.nav-menu {
  list-style: none;
  padding: 16px 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s ease;
  font-weight: 500;
  user-select: none;
}

.nav-item:hover {
  background-color: var(--bg-surface-elevated);
  color: var(--text-primary);
}

.nav-item.active {
  background-color: var(--bg-surface-elevated);
  color: var(--color-accent);
  border-left: 3px solid var(--color-accent);
  padding-left: 11px;
}

.nav-icon {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

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

/* Main Content Area */
.main-content {
  flex: 1;
  padding: 24px 32px;
  overflow-y: auto;
  max-width: 1400px;
}

/* Common View Layout */
.view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

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

.view-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-highlight);
}

.view-description {
  font-size: 13px;
  color: var(--text-secondary);
}

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

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.btn-primary {
  background-color: var(--color-accent);
  color: #0b0e14;
  font-weight: 600;
}

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

.btn-secondary {
  background-color: var(--bg-surface-elevated);
  border-color: var(--border-subtle);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background-color: var(--bg-surface-hover);
  border-color: var(--border-focus);
}

.btn-sm {
  padding: 4px 10px;
  font-size: 12px;
}

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

/* Stat Grid */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  box-shadow: var(--shadow-card);
  transition: border-color 0.2s ease;
}

.stat-card:hover {
  border-color: var(--border-focus);
}

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

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

.stat-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-highlight);
  font-family: var(--font-mono);
}

.stat-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Cards & Panels */
.panel {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  margin-bottom: 24px;
  overflow: hidden;
}

.panel-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: rgba(255, 255, 255, 0.01);
}

.panel-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-highlight);
}

.panel-body {
  padding: 20px;
}

.panel-body.no-padding {
  padding: 0;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  font-family: var(--font-mono);
}

.badge-success {
  background-color: rgba(0, 208, 132, 0.12);
  color: var(--color-success);
  border: 1px solid rgba(0, 208, 132, 0.3);
}

.badge-warning {
  background-color: rgba(255, 160, 0, 0.12);
  color: var(--color-warning);
  border: 1px solid rgba(255, 160, 0, 0.3);
}

.badge-danger {
  background-color: rgba(255, 77, 77, 0.12);
  color: var(--color-danger);
  border: 1px solid rgba(255, 77, 77, 0.3);
}

.badge-info {
  background-color: rgba(0, 112, 243, 0.12);
  color: var(--color-info);
  border: 1px solid rgba(0, 112, 243, 0.3);
}

.badge-muted {
  background-color: rgba(132, 142, 156, 0.12);
  color: var(--text-secondary);
  border: 1px solid rgba(132, 142, 156, 0.2);
}

.badge-accent {
  background-color: rgba(243, 186, 47, 0.12);
  color: var(--color-accent);
  border: 1px solid rgba(243, 186, 47, 0.3);
}

/* Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.data-table th {
  padding: 12px 16px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  background-color: var(--bg-surface-elevated);
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.data-table td {
  padding: 12px 16px;
  font-size: 13px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
  vertical-align: middle;
}

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

.data-table tr:hover td {
  background-color: var(--bg-surface-hover);
}

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

.ticker-symbol {
  font-weight: 700;
  color: var(--color-accent);
  font-family: var(--font-mono);
}

/* Filter Controls */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.search-input, .select-input {
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  padding: 6px 12px;
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
}

.search-input:focus, .select-input:focus {
  border-color: var(--color-accent);
}

/* Lineage Visualizer */
.lineage-pipeline-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.lineage-stages {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
}

.lineage-stage-card {
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  position: relative;
  transition: all 0.2s ease;
}

.lineage-stage-card.available {
  border-color: var(--color-success);
}

.lineage-stage-card.pending {
  opacity: 0.6;
  border-style: dashed;
}

.lineage-stage-card.failed {
  border-color: var(--color-danger);
}

.stage-num {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.stage-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-highlight);
  margin-top: 4px;
  margin-bottom: 8px;
}

.stage-detail {
  font-size: 11px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  word-break: break-all;
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.75);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-overlay.open {
  display: flex;
  opacity: 1;
  pointer-events: auto;
}

.modal-container {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-modal);
  width: 90%;
  max-width: 900px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  transform: translateY(20px);
  transition: transform 0.2s ease;
  overflow: hidden;
}

.modal-overlay.open .modal-container {
  transform: translateY(0);
}

.modal-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-highlight);
}

.modal-close-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
}

.modal-close-btn:hover {
  color: var(--text-primary);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 2000;
}

.toast {
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-modal);
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 280px;
  max-width: 400px;
  animation: slide-in 0.2s ease-out;
}

.toast.toast-error {
  border-left: 4px solid var(--color-danger);
}

.toast.toast-success {
  border-left: 4px solid var(--color-success);
}

@keyframes slide-in {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Pre / Code Blocks */
.code-block {
  background-color: #06080d;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: #c9d1d9;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 32px;
  margin-bottom: 12px;
}

.empty-state-text {
  font-size: 14px;
  color: var(--text-secondary);
}

/* Responsive adjustments */
@media (max-width: 992px) {
  .lineage-stages {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .app-container {
    flex-direction: column;
  }
  .app-sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border-subtle);
  }
  .nav-menu {
    flex-direction: row;
    overflow-x: auto;
  }
  .lineage-stages {
    grid-template-columns: 1fr;
  }
  .main-content {
    padding: 16px;
  }
}

/* Operational Buttons & Controls */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  padding: 6px 14px;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid transparent;
  outline: none;
  text-decoration: none;
}

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

.btn-sm {
  padding: 4px 10px;
  font-size: 12px;
}

.btn-primary {
  background-color: var(--color-accent);
  color: #0b0e14;
}

.btn-primary:hover:not(:disabled) {
  background-color: var(--color-accent-hover);
}

.btn-secondary {
  background-color: var(--bg-surface-elevated);
  color: var(--text-primary);
  border-color: var(--border-subtle);
}

.btn-secondary:hover:not(:disabled) {
  background-color: var(--bg-surface-hover);
  border-color: var(--border-focus);
}

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

.btn-danger:hover:not(:disabled) {
  background-color: #e03e3e;
}

.btn-warning {
  background-color: var(--color-warning);
  color: #0b0e14;
}

.btn-warning:hover:not(:disabled) {
  background-color: #e69100;
}

.btn-success {
  background-color: var(--color-success);
  color: #0b0e14;
}

.btn-success:hover:not(:disabled) {
  background-color: #00b875;
}

/* Emergency Stop Control Banner */
.emergency-banner {
  background-color: #121721;
  border-bottom: 1px solid var(--border-subtle);
  padding: 8px 24px;
  transition: all 0.3s ease;
}

.emergency-banner.halted {
  background: linear-gradient(90deg, rgba(255, 77, 77, 0.18), rgba(255, 77, 77, 0.08));
  border-bottom: 2px solid var(--color-danger);
  animation: banner-halt-glow 2.5s infinite;
}

@keyframes banner-halt-glow {
  0% { box-shadow: inset 0 0 10px rgba(255, 77, 77, 0.2); }
  50% { box-shadow: inset 0 0 24px rgba(255, 77, 77, 0.4); }
  100% { box-shadow: inset 0 0 10px rgba(255, 77, 77, 0.2); }
}

.emergency-banner-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.emergency-status-block {
  display: flex;
  align-items: center;
  gap: 10px;
}

.emergency-title {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.5px;
}

.emergency-banner.halted .emergency-title {
  color: var(--color-danger);
}

.emergency-desc {
  font-size: 12px;
  color: var(--text-secondary);
}

.emergency-action-block {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ==============================================================================
   Mobile-First & Touch-Friendly Responsive Adaptations (<= 768px and <= 480px)
   ============================================================================== */

/* Revalidation & One-Tap Publish Components */
.btn-publish-one-tap {
  background: #f0b90b !important;
  color: #0b0e14 !important;
  font-weight: 800 !important;
  border: none !important;
  min-height: 44px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 13px;
  letter-spacing: 0.3px;
  transition: background 0.2s, transform 0.1s;
}

.btn-publish-one-tap:hover:not(:disabled) {
  background: #ffcc4d !important;
  transform: translateY(-1px);
}

.btn-publish-one-tap:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.reval-checklist {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 14px 0;
}

.reval-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--border-subtle);
}

.reval-item.pass {
  border-left-color: var(--color-success);
}

.reval-item.fail {
  border-left-color: var(--color-danger);
  background: rgba(255, 77, 77, 0.08);
}

.reval-item.warn {
  border-left-color: var(--color-warning);
  background: rgba(255, 160, 0, 0.08);
}

.reval-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--text-primary);
}

.reval-status {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
}

/* Tablet & Mobile Media Queries (<= 768px) */
@media (max-width: 768px) {
  /* Layout: Convert Sidebar to Fixed Bottom Dock */
  body {
    padding-bottom: 68px; /* Offset for fixed bottom navigation bar */
  }

  .app-container {
    flex-direction: column;
  }

  .app-sidebar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    top: auto;
    width: 100%;
    height: 64px;
    border-right: none;
    border-top: 1px solid var(--border-subtle);
    background-color: var(--bg-surface);
    z-index: 1000;
    padding: 0;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.5);
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
  }

  .nav-menu {
    display: flex;
    flex-direction: row;
    width: 100%;
    height: 100%;
    padding: 0 4px;
    align-items: center;
    justify-content: space-around;
  }

  .nav-item {
    flex-direction: column;
    padding: 6px 8px;
    font-size: 10px;
    gap: 3px;
    border-left: none;
    border-bottom: 2px solid transparent;
    text-align: center;
    white-space: nowrap;
    min-width: 58px;
    min-height: 44px;
    justify-content: center;
  }

  .nav-item.active {
    border-left: none;
    border-bottom: 2px solid var(--color-accent);
    background: rgba(240, 185, 11, 0.08);
  }

  .nav-icon {
    font-size: 18px;
    margin-right: 0;
  }

  .sidebar-footer {
    display: none;
  }

  .main-content {
    margin-left: 0 !important;
    padding: 14px 12px 24px 12px !important;
    max-width: 100vw;
    overflow-x: hidden;
  }

  /* Header Compact for Mobile */
  .app-header {
    padding: 0 12px;
    height: auto;
    min-height: 56px;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: env(safe-area-inset-top, 0);
  }

  .brand-subtitle {
    display: none;
  }

  .header-status {
    display: none; /* Collapsed on mobile, available in Control Center cards */
  }

  .header-controls {
    gap: 6px;
  }

  /* Touch Targets (min 44px) */
  .btn, button, select, input[type="text"], input[type="password"] {
    min-height: 44px;
    font-size: 13px;
  }

  .btn-sm {
    min-height: 40px;
    padding: 6px 12px;
  }

  /* Modals Full-Width on Mobile */
  .modal-overlay {
    padding: 8px;
  }

  .modal-container {
    width: 100% !important;
    max-width: 100% !important;
    margin: auto 0 !important;
    max-height: 88vh !important;
    padding: 16px !important;
    border-radius: 12px !important;
  }

  .modal-close-btn {
    width: 44px;
    height: 44px;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Draft Cards on Mobile: Vertical Action Stacking */
  .draft-approval-card {
    padding: 12px !important;
  }

  .draft-approval-card .draft-actions {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    width: 100%;
    gap: 8px;
    margin-top: 12px;
  }

  .draft-approval-card .draft-actions .btn {
    width: 100%;
    text-align: center;
    justify-content: center;
  }

  .draft-approval-card .draft-actions .btn-publish-one-tap,
  .draft-approval-card .draft-actions .btn-deploy-draft {
    grid-column: 1 / -1; /* Spans full width for primary action */
    min-height: 46px;
    font-size: 14px;
  }

  /* Responsive Tables with Smooth Touch Momentum Scroll */
  .table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
  }

  /* Stat Grids: 2 Columns */
  .panel-body > div[style*="grid-template-columns"] {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }
}

/* Smartphone Small Screens (<= 480px) */
@media (max-width: 480px) {
  .brand-title {
    font-size: 13px;
  }

  .header-controls .badge {
    display: none;
  }

  .draft-approval-card .draft-actions {
    grid-template-columns: 1fr !important; /* Single column on phones */
  }

  .panel-body > div[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important; /* Stack stats on very small phones */
  }
}

/* ==============================================================================
   Dedicated "PUBLISH ONE SIGNAL" Operator Workflow
   ============================================================================== */
.publish-one-signal-card {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.publish-one-signal-card:hover {
  box-shadow: 0 6px 30px rgba(240, 185, 11, 0.28) !important;
}

#btn-cc-publish-one-signal:hover, #btn-cc-top-publish-one:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

#btn-cc-publish-one-signal:active, #btn-cc-top-publish-one:active {
  transform: translateY(1px);
}

.publish-one-preview-levels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.publish-one-level-box {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  text-align: center;
}

.publish-one-level-box .level-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
  margin-bottom: 4px;
}

.publish-one-level-box .level-val {
  font-size: 15px;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--text-primary);
}

.publish-one-validation-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  margin-bottom: 16px;
}

.publish-one-validation-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.publish-one-validation-table tr:last-child td {
  border-bottom: none;
}

@media (max-width: 768px) {
  .publish-one-signal-card {
    flex-direction: column;
    align-items: stretch !important;
  }
  .publish-one-signal-card button {
    width: 100%;
    justify-content: center;
  }
  .publish-one-preview-levels {
    grid-template-columns: repeat(2, 1fr);
  }
}


