/* Eagle Platform — Global Styles */
:root {
  --bg: #0f1117;
  --bg-card: #1a1d27;
  --bg-input: #252836;
  --border: #2e3244;
  --text: #e4e4e7;
  --text-muted: #8b8d9e;
  --primary: #6366f1;
  --primary-hover: #818cf8;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --radius: 8px;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;

  /* Eagle lifecycle colors (from deck) */
  --eagle-green: #4ade80;
  --eagle-blue: #60a5fa;
  --eagle-cyan: #22d3ee;
  --eagle-orange: #fb923c;
  --eagle-amber: #fbbf24;
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }

/* Layout */
.app-layout { display: flex; min-height: 100vh; }

.sidebar {
  width: 260px;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

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

.sidebar-logo-icon {
  width: 28px;
  height: 28px;
  position: relative;
  flex-shrink: 0;
}

.sidebar-logo-icon .l-v {
  position: absolute; left: 0; top: 0;
  width: 6px; height: 28px;
  background: #fff; border-radius: 1px;
}

.sidebar-logo-icon .l-h {
  position: absolute; left: 0; bottom: 0;
  width: 28px; height: 6px;
  background: #fff; border-radius: 1px;
}

.sidebar-brand-text {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: #fff;
}

.sidebar-modules {
  flex: 1;
  padding: 8px 0;
  overflow-y: auto;
}

/* Section headers (collapsible categories) */
.nav-section {
  margin-top: 4px;
}

.nav-section-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 20px 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  cursor: pointer;
  user-select: none;
  transition: opacity 0.15s;
}

.nav-section-header:hover { opacity: 0.8; }

.nav-section-header .chevron {
  font-size: 9px;
  transition: transform 0.2s;
  opacity: 0.5;
}

.nav-section.collapsed .chevron {
  transform: rotate(-90deg);
}

.nav-section.collapsed .nav-section-items {
  display: none;
}

.nav-section-header.color-green { color: var(--eagle-green); }
.nav-section-header.color-cyan { color: var(--eagle-cyan); }
.nav-section-header.color-amber { color: var(--eagle-amber); }

.nav-section-items {
  list-style: none;
}

.nav-section-items a,
.nav-section-items .nav-disabled {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 20px 6px 32px;
  font-size: 13px;
  color: var(--text-muted);
  border-radius: 0;
  transition: all 0.15s;
}

.nav-section-items a:hover,
.nav-section-items a.active {
  background: var(--bg-input);
  color: var(--text);
}

.nav-section-items a.active {
  border-left: 2px solid var(--primary);
  padding-left: 30px;
}

.nav-section-items .nav-disabled {
  opacity: 0.35;
  cursor: default;
}

.nav-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  flex-shrink: 0;
}

.nav-dot.filled {
  background: currentColor;
}

.sidebar-user {
  border-top: 1px solid var(--border);
  padding: 12px 20px;
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sidebar-user button {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 12px;
  font-family: var(--font);
}
.sidebar-user button:hover { color: var(--text); }

.main-content {
  flex: 1;
  padding: 32px;
  overflow-y: auto;
}

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
}

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

.card-title { font-size: 16px; font-weight: 600; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s;
  font-family: var(--font);
}

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

.btn-danger { background: transparent; color: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: white; }

.btn-ghost { background: transparent; color: var(--text-muted); border-color: var(--border); }
.btn-ghost:hover { color: var(--text); border-color: var(--text-muted); }

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

/* Forms */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 13px; font-weight: 500; color: var(--text-muted); margin-bottom: 6px; }
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 14px;
  font-family: var(--font);
  outline: none;
  transition: border-color 0.15s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus { border-color: var(--primary); }
.form-textarea { min-height: 80px; resize: vertical; }

/* Login page */
.login-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

.login-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 40px;
  width: 100%;
  max-width: 400px;
}

.login-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

.login-logo-icon {
  width: 48px; height: 48px;
  position: relative;
}

.login-logo-icon .l-v {
  position: absolute; left: 0; top: 0;
  width: 10px; height: 48px;
  background: #fff; border-radius: 2px;
}

.login-logo-icon .l-h {
  position: absolute; left: 0; bottom: 0;
  width: 48px; height: 10px;
  background: #fff; border-radius: 2px;
}

.login-title { font-size: 24px; font-weight: 600; text-align: center; margin-bottom: 4px; }
.login-subtitle { font-size: 14px; color: var(--text-muted); text-align: center; margin-bottom: 32px; }

.login-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--danger);
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 16px;
  display: none;
}

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: 14px; }
th { font-weight: 500; color: var(--text-muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; }
tr:hover td { background: rgba(99, 102, 241, 0.05); }

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px;
  width: 100%;
  max-width: 440px;
}

.modal-title { font-size: 18px; font-weight: 600; margin-bottom: 8px; }
.modal-subtitle { font-size: 13px; color: var(--text-muted); margin-bottom: 24px; }

/* Upload zone */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 40px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
}

.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.05);
}

.upload-zone-text { color: var(--text-muted); font-size: 14px; }
.upload-zone-text strong { color: var(--primary); }

/* Status */
.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 6px; }
.status-dot.green { background: var(--success); }
.status-dot.yellow { background: var(--warning); }
.status-dot.red { background: var(--danger); }

/* Empty state */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-state-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.5; }
.empty-state-text { font-size: 15px; margin-bottom: 8px; }

/* Helpers */
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 12px; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.flex { display: flex; }
.gap-2 { gap: 8px; }
.gap-4 { gap: 16px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }

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

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

/* Toasts */
.toast-container { position: fixed; top: 20px; right: 20px; z-index: 2000; }
.toast {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 8px;
  font-size: 13px;
  animation: slideIn 0.2s;
  max-width: 360px;
}
.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--danger); }

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

/* Category pill */
.category-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  background: rgba(99, 102, 241, 0.15);
  color: var(--primary-hover);
}

/* Responsive */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: -260px;
    top: 0; bottom: 0;
    z-index: 100;
    transition: left 0.2s;
  }
  .sidebar.open { left: 0; }
  .main-content { padding: 16px; }
  .mobile-menu-btn {
    display: block;
    position: fixed;
    top: 12px; left: 12px;
    z-index: 99;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 8px 12px;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 18px;
  }
}

@media (min-width: 769px) {
  .mobile-menu-btn { display: none; }
}
