/**
 * Speedy Panel - Premium Dark Theme
 * Matching Speedy CMS visual style
 */

/* =============================================================================
   CSS Variables - Color Palette
   ============================================================================= */
:root {
  /* Background colors */
  --bg-body: #0d1117;
  --bg-card: #161b22;
  --bg-card-hover: #1c2128;
  --bg-sidebar: #0d1117;
  --bg-topbar: #161b22;
  --bg-input: #0d1117;
  --bg-dropdown: #1c2128;
  --bg-table-header: #21262d;
  --bg-table-row-hover: #1c2128;
  
  /* Border colors */
  --border-subtle: #30363d;
  --border-focus: #58a6ff;
  --border-input: #30363d;
  
  /* Text colors */
  --text-primary: #e6edf3;
  --text-secondary: #8b949e;
  --text-muted: #6e7681;
  --text-link: #58a6ff;
  
  /* Accent colors */
  --accent-gold: #d4a853;
  --accent-gold-hover: #e6b84d;
  --accent-gold-text: #1c1917;
  --accent-blue: #58a6ff;
  --accent-green: #238636;
  --accent-red: #da3633;
  --accent-orange: #d29922;
  
  /* Status colors */
  --status-active: #238636;
  --status-active-bg: rgba(35, 134, 54, 0.15);
  --status-inactive: #6e7681;
  --status-inactive-bg: rgba(110, 118, 129, 0.15);
  --status-warning: #d29922;
  --status-warning-bg: rgba(210, 153, 34, 0.15);
  --status-danger: #da3633;
  --status-danger-bg: rgba(218, 54, 51, 0.15);
  
  /* Spacing */
  --sidebar-width: 260px;
  --topbar-height: 56px;
  --content-max-width: 1400px;
  --card-padding: 24px;
  --border-radius: 8px;
  --border-radius-sm: 4px;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px rgba(212, 168, 83, 0.1);
  
  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;
}

/* =============================================================================
   Reset & Base Styles
   ============================================================================= */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background-color: var(--bg-body);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
}

a {
  color: var(--text-link);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--accent-gold);
}

/* =============================================================================
   Layout Structure
   ============================================================================= */
.panel-layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.panel-main {
  display: flex;
  flex: 1;
  padding-top: var(--topbar-height);
}

.panel-content {
  flex: 1;
  margin-right: var(--sidebar-width);
  padding: 24px;
  min-width: 0;
}

.panel-content-inner {
  max-width: var(--content-max-width);
  margin: 0 auto;
}

/* =============================================================================
   Topbar
   ============================================================================= */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--topbar-height);
  background: var(--bg-topbar);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  padding: 0 20px;
  z-index: 1000;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-right: 32px;
}

.topbar-brand-icon {
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-orange));
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  color: var(--bg-body);
  font-size: 14px;
}

.topbar-search {
  flex: 1;
  max-width: 400px;
  margin: 0 auto;
}

.topbar-search-input {
  width: 100%;
  height: 36px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius);
  padding: 0 12px 0 36px;
  color: var(--text-primary);
  font-size: 13px;
  transition: all var(--transition-fast);
}

.topbar-search-input::placeholder {
  color: var(--text-muted);
}

.topbar-search-input:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.15);
}

.topbar-search-wrapper {
  position: relative;
}

.topbar-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.command-palette .modal-body {
  padding: 20px;
}

.command-palette-input {
  margin-bottom: 12px;
}

.command-palette-results {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.command-palette-item {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius-sm);
  color: var(--text-primary);
  cursor: pointer;
  text-align: left;
  transition: all var(--transition-fast);
}

.command-palette-item:hover,
.command-palette-item.active {
  background: var(--bg-card-hover);
  border-color: var(--accent-gold);
}

.command-palette-item-title {
  font-size: 13px;
  font-weight: 600;
}

.command-palette-item-meta {
  font-size: 11px;
  color: var(--text-muted);
}

.command-palette-empty {
  display: none;
  padding: 12px 4px;
  font-size: 12px;
  color: var(--text-muted);
}

.command-palette-empty.visible {
  display: block;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.topbar-icon-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--border-radius);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.topbar-icon-btn:hover {
  background: var(--bg-card);
  color: var(--text-primary);
  border-color: var(--border-subtle);
}

.topbar-dropdown {
  position: relative;
}

.topbar-dropdown-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius);
  color: var(--text-primary);
  font-size: 13px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.topbar-dropdown-btn:hover {
  background: var(--bg-card-hover);
}

.topbar-user-avatar {
  width: 24px;
  height: 24px;
  background: var(--accent-gold);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--bg-body);
}

/* =============================================================================
   Right Sidebar
   ============================================================================= */
.sidebar-right {
  position: fixed;
  top: var(--topbar-height);
  right: 0;
  width: var(--sidebar-width);
  height: calc(100vh - var(--topbar-height));
  background: var(--bg-sidebar);
  border-left: 1px solid var(--border-subtle);
  overflow-y: auto;
  z-index: 900;
}

.sidebar-inner {
  padding: 16px 0;
}

.sidebar-section {
  margin-bottom: 8px;
}

.sidebar-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
  transition: color var(--transition-fast);
}

.sidebar-section-header:hover {
  color: var(--text-secondary);
}

.sidebar-section-toggle {
  font-size: 10px;
  transition: transform var(--transition-fast);
}

.sidebar-section.collapsed .sidebar-section-toggle {
  transform: rotate(-90deg);
}

.sidebar-section.collapsed .sidebar-nav {
  display: none;
}

.sidebar-nav {
  list-style: none;
}

.sidebar-nav-item {
  margin: 1px 8px;
}

.sidebar-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--text-secondary);
  border-radius: var(--border-radius-sm);
  transition: all var(--transition-fast);
}

.sidebar-nav-link:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}

.sidebar-nav-link.active {
  background: var(--bg-card);
  color: var(--accent-gold);
  font-weight: 500;
}

.sidebar-nav-icon {
  width: 16px;
  height: 16px;
  opacity: 0.7;
}

.sidebar-nav-link.active .sidebar-nav-icon {
  opacity: 1;
}

/* =============================================================================
   Page Header
   ============================================================================= */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
}

.page-header-content {
  flex: 1;
}

.page-title {
  font-size: 24px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.page-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
}

.page-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  flex-shrink: 0;
}

/* =============================================================================
   Cards
   ============================================================================= */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius);
  overflow: hidden;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0;
  border-bottom: none;
  min-height: 56px;
  padding-left: 24px;
  padding-right: 24px;
}

.card-header .tabs {
  flex: 0 1 auto;
  margin: 0;
  border-bottom: 2px solid var(--border-subtle);
}

.card-header-actions {
  padding: 0 24px;
  display: flex;
  align-items: center;
  height: 56px;
  gap: 8px;
  margin-left: auto;
}

/* Page header row for tabs + controls */
.sp-pageHeaderRow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  width: 100%;
}

.sp-pageHeaderRow__right {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 24px;
  height: 44px;
}

.card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.card-body {
  padding: var(--card-padding);
}

.card-footer {
  padding: 16px var(--card-padding);
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-table-header);
}

.sp-serviceCategory {
  margin-bottom: 40px;
}

.sp-serviceCategoryTitle {
  font-size: 20px;
  margin-bottom: 16px;
  color: rgba(255, 255, 255, 0.9);
  text-transform: capitalize;
}

.sp-serviceGrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
  align-items: stretch;
}

.sp-serviceCard {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 0;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.sp-serviceCard:hover {
  border-color: rgba(66, 153, 225, 0.5);
}

.sp-serviceCard.is-muted {
  opacity: 0.7;
}

.sp-serviceCardHeader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sp-serviceCardHeader h3 {
  font-size: 18px;
  margin: 0;
  color: rgba(255, 255, 255, 0.95);
}

.sp-serviceBadges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.sp-serviceCardContent {
  padding: 16px 20px;
  line-height: 1.5;
  flex: 1;
}

.sp-serviceDescription {
  color: rgba(255, 255, 255, 0.6);
  font-size: 14px;
  margin-bottom: 12px;
}

.sp-serviceVersion {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 12px;
}

.sp-serviceVersion code {
  background: rgba(255, 255, 255, 0.05);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
}

.sp-serviceError {
  background: rgba(220, 38, 38, 0.1);
  color: rgba(248, 113, 113, 0.9);
  padding: 8px;
  border-radius: 4px;
  font-size: 13px;
  margin-top: 12px;
}

.sp-serviceCardFooter {
  padding: 16px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
  margin-top: auto;
}


.sp-serviceActions {
  margin-top: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.sp-serviceActionsLeft {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.sp-serviceActionsRight {
  margin-left: auto;
  display: flex;
  align-items: center;
}

.sp-serviceActions form {
  margin: 0;
}

@media (max-width: 1200px) {
  .sp-serviceGrid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .sp-serviceGrid {
    grid-template-columns: 1fr;
  }
}

/* =============================================================================
   Buttons
   ============================================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 1px solid transparent;
  text-decoration: none;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Primary (Gold) */
.btn-primary {
  background: var(--accent-gold);
  color: var(--accent-gold-text);
  border-color: var(--accent-gold);
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-gold-hover);
  border-color: var(--accent-gold-hover);
  color: var(--accent-gold-text);
}

/* Secondary (Ghost) */
.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--border-subtle);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--bg-card);
  color: var(--text-primary);
}

/* Danger */
.btn-danger {
  background: var(--status-danger);
  color: white;
  border-color: var(--status-danger);
}

.btn-danger:hover:not(:disabled) {
  background: #e54b48;
  border-color: #e54b48;
  color: white;
}

/* Success */
.btn-success {
  background: var(--status-active);
  color: white;
  border-color: var(--status-active);
}

/* Icon button */
.btn-icon {
  width: 36px;
  padding: 0;
}

/* Small button */
.btn-sm {
  height: 28px;
  padding: 0 10px;
  font-size: 12px;
}



/* =============================================================================
   Status Badges
   ============================================================================= */
.badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 500;
  border-radius: 11px;
  text-transform: capitalize;
}

.badge-active, .badge-success {
  background: var(--status-active-bg);
  color: var(--status-active);
}

.badge-inactive, .badge-default {
  background: var(--status-inactive-bg);
  color: var(--status-inactive);
}

.badge-warning, .badge-pending {
  background: var(--status-warning-bg);
  color: var(--status-warning);
}

.badge-danger, .badge-error {
  background: var(--status-danger-bg);
  color: var(--status-danger);
}

/* =============================================================================
   Forms
   ============================================================================= */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.form-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  font-size: 14px;
  color: var(--text-primary);
  background: var(--bg-input);
  border: 1px solid var(--border-input);
  border-radius: var(--border-radius);
  transition: all var(--transition-fast);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.15);
}

.form-input::placeholder {
  color: var(--text-muted);
}

.form-textarea {
  height: auto;
  min-height: 100px;
  padding: 12px;
  resize: vertical;
}

.form-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238b949e' d='M3 4.5L6 7.5L9 4.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.form-checkbox-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-checkbox {
  width: 18px;
  height: 18px;
  accent-color: var(--accent-gold);
}

/* =============================================================================
   Filter Bar
   ============================================================================= */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 16px var(--card-padding);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius);
  margin-bottom: 16px;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.filter-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.filter-input {
  height: 36px;
  min-width: 180px;
}

.filter-actions {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin-left: auto;
}

/* =============================================================================
   Empty State
   ============================================================================= */
.empty-state {
  text-align: center;
  padding: 48px 24px;
}

.empty-state-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  color: var(--text-muted);
  opacity: 0.5;
}

.empty-state-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.empty-state-text {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

/* =============================================================================
   Dashboard Widgets
   ============================================================================= */
.widget-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.widget {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius);
  padding: 20px;
}

.widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.widget-title {
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
}

.widget-icon {
  width: 20px;
  height: 20px;
  color: var(--accent-gold);
}

.widget-value {
  font-size: 32px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1;
}

.widget-change {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  margin-top: 8px;
}

.widget-change.positive {
  color: var(--status-active);
}

.widget-change.negative {
  color: var(--status-danger);
}

.widget-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 8px;
}

/* Widget expandable details */
.widget-expandable {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
  cursor: pointer;
  user-select: none;
  transition: color var(--transition-fast);
}

.widget-expandable:hover {
  color: var(--accent-gold);
}

.widget-expandable svg {
  transition: transform var(--transition-fast);
}

.widget-expandable.active svg {
  transform: rotate(180deg);
}

.widget-details {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
  animation: slideDown 0.2s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* CPU per-core usage */
.core-usage-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.core-usage-item {
  display: grid;
  grid-template-columns: 45px 1fr 50px;
  align-items: center;
  gap: 10px;
  font-size: 11px;
}

.core-label {
  color: var(--text-muted);
  font-weight: 500;
}

.core-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
  overflow: hidden;
}

.core-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-gold), var(--accent-gold-hover));
  border-radius: 3px;
  transition: width var(--transition-normal);
}

.core-value {
  text-align: right;
  color: var(--text-primary);
  font-weight: 500;
}

.widget-detail-meta {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 11px;
  color: var(--text-muted);
}

/* Memory breakdown */
.memory-breakdown {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.memory-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  padding: 6px 0;
}

.memory-item.muted .memory-label,
.memory-item.muted .memory-value {
  color: var(--text-muted);
}

.memory-item.warning .memory-label,
.memory-item.warning .memory-value {
  color: var(--status-warning);
}

.memory-label {
  color: var(--text-secondary);
  font-weight: 500;
}

.memory-value {
  color: var(--text-primary);
  font-weight: 600;
}

/* Disk table */
.disk-table-wrapper {
  overflow-x: auto;
  margin: -4px;
}

.disk-table {
  width: 100%;
  font-size: 11px;
  border-collapse: collapse;
}

.disk-table thead th {
  text-align: left;
  padding: 8px 6px;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-subtle);
}

.disk-table tbody td {
  padding: 8px 6px;
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.disk-table tbody tr:last-child td {
  border-bottom: none;
}

.disk-table tbody tr.warning {
  background: rgba(210, 153, 34, 0.05);
}

.disk-table tbody tr.warning td {
  color: var(--text-primary);
}

/* Network table */
.network-table-wrapper {
  overflow-x: auto;
  margin: -4px;
}

.network-table {
  width: 100%;
  font-size: 11px;
  border-collapse: collapse;
}

.network-table thead th {
  text-align: left;
  padding: 8px 6px;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-subtle);
}

.network-table tbody td {
  padding: 8px 6px;
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.network-table tbody tr:last-child td {
  border-bottom: none;
}

.network-table tbody tr.muted td {
  opacity: 0.5;
}

/* =============================================================================
   Quick Actions
   ============================================================================= */
.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.quick-action {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.quick-action:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-gold);
  color: var(--text-primary);
}

.quick-action-icon {
  width: 20px;
  height: 20px;
  color: var(--accent-gold);
}

/* =============================================================================
   Dropdown Menu
   ============================================================================= */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  min-width: 180px;
  background: var(--bg-dropdown);
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  z-index: 1000;
  display: none;
}

.dropdown.open .dropdown-menu {
  display: block;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--text-primary);
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.dropdown-item:hover {
  background: var(--bg-card);
}

.dropdown-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 6px 0;
}

/* =============================================================================
   Alerts & Messages
   ============================================================================= */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--border-radius);
  font-size: 14px;
  margin-bottom: 16px;
}

.alert-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}

.alert-content {
  flex: 1;
}

.alert-title {
  font-weight: 600;
  margin-bottom: 2px;
}

.alert-info {
  background: rgba(88, 166, 255, 0.1);
  border: 1px solid rgba(88, 166, 255, 0.3);
  color: var(--accent-blue);
}

.alert-success {
  background: var(--status-active-bg);
  border: 1px solid rgba(35, 134, 54, 0.3);
  color: var(--status-active);
}

.alert-warning {
  background: var(--status-warning-bg);
  border: 1px solid rgba(210, 153, 34, 0.3);
  color: var(--status-warning);
}

.alert-danger {
  background: var(--status-danger-bg);
  border: 1px solid rgba(218, 54, 51, 0.3);
  color: var(--status-danger);
}

/* Button Spinner */
.btn-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 1s ease-in-out infinite;
  margin-right: 8px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}


/* =============================================================================
   Responsive
   ============================================================================= */
@media (max-width: 1200px) {
  :root {
    --sidebar-width: 220px;
  }
}

@media (max-width: 992px) {
  .sidebar-right {
    transform: translateX(100%);
    transition: transform var(--transition-normal);
  }
  
  .sidebar-right.open {
    transform: translateX(0);
  }
  
  .panel-content {
    margin-right: 0;
  }
}

@media (max-width: 768px) {
  .topbar-search {
    display: none;
  }
  
  .page-header {
    flex-direction: column;
    gap: 16px;
  }
  
  .page-actions {
    width: 100%;
  }
  
  .filter-bar {
    flex-direction: column;
  }
  
  .filter-group {
    width: 100%;
  }
  
  .filter-input {
    width: 100%;
    min-width: 0;
  }
  
  .filter-actions {
    margin-left: 0;
    width: 100%;
    justify-content: flex-end;
  }
}

/* =============================================================================
   Utilities
   ============================================================================= */
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-primary { color: var(--text-primary); }
.text-xs { font-size: 12px; }
.text-sm { font-size: 13px; }
.font-mono { font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', monospace; }
.text-right { text-align: right; }
.text-center { text-align: center; }

/* Spacing utilities */
.mt-2 { margin-top: 16px; }
.mb-2 { margin-bottom: 16px; }
.ml-1 { margin-left: 8px; }
.mr-1 { margin-right: 8px; }
.text-success { color: var(--status-active); }
.text-danger { color: var(--status-danger); }
.text-warning { color: var(--status-warning); }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

.d-flex { display: flex; }
.align-items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
