/* =========================================================
   FCP Command Center — Design System CSS
   Brand: Navy #0a1628, Red #c41e3a, Gold #d4a843
   ========================================================= */

/* --- Custom Properties --- */
:root {
  --color-navy: #0a1628;
  --color-navy-light: #0f1d32;
  --color-card: #1a2942;
  --color-card-elevated: #1e3050;
  --color-border: #2a3f5f;
  --color-border-light: #354d6e;
  --color-red: #c41e3a;
  --color-red-dark: #a01830;
  --color-gold: #d4a843;
  --color-gold-light: #e0be6a;
  --color-text: #e2e8f0;
  --color-text-muted: #94a3b8;
  --color-text-dim: #64748b;
  --color-success: #22c55e;
  --color-warning: #f59e0b;
  --color-error: #ef4444;
  --color-info: #3b82f6;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-glow-red: 0 0 20px rgba(196, 30, 58, 0.2);
  --shadow-glow-gold: 0 0 20px rgba(212, 168, 67, 0.2);
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;
}

/* --- Base --- */
*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--color-navy);
  color: var(--color-text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* --- Buttons --- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 18px;
  background: linear-gradient(135deg, var(--color-red) 0%, var(--color-red-dark) 100%);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}
.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(196, 30, 58, 0.35);
}
.btn-primary:active:not(:disabled) { transform: translateY(0); }
.btn-primary:focus-visible { outline: 2px solid var(--color-gold); outline-offset: 2px; }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 18px;
  background: transparent;
  color: var(--color-gold);
  border: 1px solid var(--color-gold);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
}
.btn-secondary:hover:not(:disabled) {
  background: rgba(212, 168, 67, 0.1);
}
.btn-secondary:active:not(:disabled) { background: rgba(212, 168, 67, 0.15); }
.btn-secondary:focus-visible { outline: 2px solid var(--color-gold); outline-offset: 2px; }
.btn-secondary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 18px;
  background: transparent;
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast);
}
.btn-ghost:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--color-border-light);
}
.btn-ghost:focus-visible { outline: 2px solid var(--color-gold); outline-offset: 2px; }
.btn-ghost:disabled { opacity: 0.5; cursor: not-allowed; }

/* --- Cards --- */
.card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  box-shadow: var(--shadow-sm);
}

.card-elevated {
  background: var(--color-card-elevated);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  box-shadow: var(--shadow-md);
}

/* --- Inputs --- */
.input {
  width: 100%;
  padding: 8px 12px;
  background: var(--color-navy);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text);
  font-size: 0.875rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.input:focus {
  outline: none;
  border-color: var(--color-gold);
  box-shadow: 0 0 0 3px rgba(212, 168, 67, 0.15);
}
.input::placeholder { color: var(--color-text-dim); }
.input:disabled { opacity: 0.5; cursor: not-allowed; }

select.input { cursor: pointer; }

/* --- Badges --- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.badge-success { background: rgba(34, 197, 94, 0.15); color: #4ade80; }
.badge-warning { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.badge-error   { background: rgba(239, 68, 68, 0.15); color: #f87171; }
.badge-info    { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.badge-neutral { background: rgba(148, 163, 184, 0.15); color: #94a3b8; }
.badge-gold    { background: rgba(212, 168, 67, 0.15); color: var(--color-gold); }

/* --- Tables --- */
.table-dark {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.table-dark th {
  text-align: left;
  padding: 10px 12px;
  background: var(--color-navy-light);
  color: var(--color-text-muted);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--color-border);
}
.table-dark td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text);
}
.table-dark tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* --- Modal --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: var(--spacing-md);
  animation: fadeIn 0.2s ease;
}

.modal-card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: slideInUp 0.3s ease;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--spacing-md) var(--spacing-lg);
  border-bottom: 1px solid var(--color-border);
}
.modal-header h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-text);
}

.modal-body {
  padding: var(--spacing-lg);
}

/* --- Toast --- */
.toast-container {
  position: fixed;
  top: var(--spacing-md);
  right: var(--spacing-md);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
  pointer-events: none;
}

.toast-item {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  color: #fff;
  box-shadow: var(--shadow-md);
  animation: toastIn 0.3s ease forwards;
  max-width: 360px;
}
.toast-item.removing { animation: toastOut 0.3s ease forwards; }

.toast-success { background: #16a34a; }
.toast-error   { background: #dc2626; }
.toast-warning { background: #d97706; }
.toast-info    { background: #2563eb; }

/* --- Loading Spinner --- */
.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--color-border);
  border-top-color: var(--color-gold);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
.loading-spinner.lg {
  width: 36px;
  height: 36px;
  border-width: 3px;
}

/* --- Animations --- */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(16px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes slideInUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(40px); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* --- Utility Classes --- */
.animate-fade-in { animation: fadeIn 0.3s ease forwards; }
.animate-slide-right { animation: slideInRight 0.3s ease forwards; }
.animate-slide-up { animation: slideInUp 0.3s ease forwards; }
.animate-pulse { animation: pulse 2s ease-in-out infinite; }

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--color-navy); }
::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: var(--color-border-light); }

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--color-border) var(--color-navy);
}

/* --- Print Styles --- */
@media print {
  body { background: #fff; color: #000; }
  .toast-container, .modal-overlay { display: none !important; }
  .card, .card-elevated {
    background: #fff;
    border: 1px solid #ccc;
    box-shadow: none;
  }
  .table-dark th { background: #f3f4f6; color: #374151; }
  .table-dark td { border-color: #e5e7eb; color: #111827; }
  .badge { border: 1px solid currentColor; }
}
