/* ============================================================
   LCO 2026 — ConnectUAV Design System
   powercorLCO.connectuav.com
   ============================================================ */

:root {
  --bg-deep:    #0b1220;
  --bg-navy:    #1d2e4f;
  --bg-card:    #162040;
  --bg-surface: #1a2a45;

  --gold:       #dbc078;
  --gold-dim:   #a8905a;
  --gold-bg:    rgba(219,192,120,0.08);
  --gold-border:rgba(219,192,120,0.25);

  --text-primary:   #f0f4ff;
  --text-secondary: #8aa4cc;
  --text-muted:     #4a6080;

  --green:      #4ade80;
  --green-bg:   rgba(74,222,128,0.1);
  --amber:      #f59e0b;
  --amber-bg:   rgba(245,158,11,0.1);
  --red:        #f87171;
  --red-bg:     rgba(248,113,113,0.1);
  --blue:       #60a5fa;
  --blue-bg:    rgba(96,165,250,0.1);

  --border:     rgba(255,255,255,0.07);
  --border-mid: rgba(255,255,255,0.12);
  --border-gold:rgba(219,192,120,0.3);

  --radius-sm:  6px;
  --radius-md:  10px;
  --radius-lg:  14px;
  --radius-xl:  20px;

  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', monospace;

  --transition: 0.15s ease;
}

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

html { font-size: 16px; -webkit-font-smoothing: antialiased; }

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

/* ── Typography ──────────────────────────────────────────── */

h1 { font-size: 1.5rem; font-weight: 500; }
h2 { font-size: 1.2rem; font-weight: 500; }
h3 { font-size: 1rem;   font-weight: 500; }

.text-secondary { color: var(--text-secondary); }
.text-muted     { color: var(--text-muted); }
.text-gold      { color: var(--gold); }
.text-green     { color: var(--green); }
.text-amber     { color: var(--amber); }
.text-red       { color: var(--red); }

.label {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

/* ── Layout ──────────────────────────────────────────────── */

.page-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }

@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* ── Topbar ──────────────────────────────────────────────── */

.topbar {
  background: var(--bg-navy);
  border-bottom: 1px solid var(--border);
  padding: 0 1.5rem;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar-logo {
  font-size: 15px;
  font-weight: 500;
  color: var(--gold);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.topbar-logo span {
  color: var(--text-secondary);
  font-weight: 400;
}

.topbar-divider {
  width: 1px;
  height: 20px;
  background: var(--border-mid);
}

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

.topbar-spacer { flex: 1; }

.topbar-pill {
  font-size: 11px;
  padding: 4px 12px;
  border-radius: 20px;
  background: var(--gold-bg);
  color: var(--gold);
  border: 1px solid var(--gold-border);
  white-space: nowrap;
}

.topbar-user {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-mid);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 500;
  cursor: pointer;
}

/* ── Cards ───────────────────────────────────────────────── */

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}

.card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.card-title {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  flex: 1;
}

/* ── Stat cards ──────────────────────────────────────────── */

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
}

.stat-card .label { margin-bottom: 6px; }

.stat-num {
  font-size: 2rem;
  font-weight: 500;
  line-height: 1;
  color: var(--text-primary);
}

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

/* ── Progress bars ───────────────────────────────────────── */

.bar-track {
  height: 6px;
  background: var(--bg-surface);
  border-radius: 3px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease;
}

.bar-fill.green  { background: var(--green); }
.bar-fill.gold   { background: var(--gold); }
.bar-fill.amber  { background: var(--amber); }
.bar-fill.red    { background: var(--red); }
.bar-fill.navy   { background: #3a5a9a; }

/* ── Badges / status pills ───────────────────────────────── */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}

.badge.green  { background: var(--green-bg);  color: var(--green); }
.badge.amber  { background: var(--amber-bg);  color: var(--amber); }
.badge.red    { background: var(--red-bg);    color: var(--red); }
.badge.gold   { background: var(--gold-bg);   color: var(--gold); border: 1px solid var(--gold-border); }
.badge.blue   { background: var(--blue-bg);   color: var(--blue); }
.badge.muted  { background: rgba(255,255,255,0.05); color: var(--text-muted); }

/* ── Buttons ─────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition);
  white-space: nowrap;
  text-decoration: none;
}

.btn-primary {
  background: var(--gold);
  color: #0b1220;
  border-color: var(--gold);
}
.btn-primary:hover { background: #e8d08a; }

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--border-mid);
}
.btn-secondary:hover { background: var(--bg-surface); }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: transparent;
}
.btn-ghost:hover { color: var(--text-primary); background: var(--bg-surface); }

.btn-danger {
  background: var(--red-bg);
  color: var(--red);
  border-color: rgba(248,113,113,0.3);
}
.btn-danger:hover { background: rgba(248,113,113,0.2); }

.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-lg { padding: 12px 24px; font-size: 15px; }

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

/* ── Forms ───────────────────────────────────────────────── */

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 1rem;
}

.form-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}

.form-input {
  background: var(--bg-surface);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: 14px;
  color: var(--text-primary);
  font-family: var(--font);
  transition: border-color var(--transition);
  width: 100%;
}

.form-input:focus {
  outline: none;
  border-color: var(--gold-dim);
}

.form-input::placeholder { color: var(--text-muted); }

select.form-input {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%238aa4cc' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

/* ── Tables ──────────────────────────────────────────────── */

.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th {
  text-align: left;
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
  vertical-align: middle;
}

tr:hover td { background: var(--bg-surface); }
tr:last-child td { border-bottom: none; }

/* ── Sidebar layout ──────────────────────────────────────── */

.app-layout {
  display: flex;
  min-height: calc(100vh - 56px);
}

.sidebar {
  width: 200px;
  background: var(--bg-navy);
  border-right: 1px solid var(--border);
  flex-shrink: 0;
  padding: 1rem 0;
}

.sidebar-section {
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 12px 16px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  border-left: 2px solid transparent;
  transition: var(--transition);
  text-decoration: none;
}

.nav-item:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,0.03);
}

.nav-item.active {
  color: var(--gold);
  border-left-color: var(--gold);
  background: var(--gold-bg);
}

.nav-item i { font-size: 16px; }

.main-content {
  flex: 1;
  padding: 1.5rem;
  overflow: auto;
}

/* ── Live dot ────────────────────────────────────────────── */

.live-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--green);
  display: inline-block;
}

/* ── Toast notifications ─────────────────────────────────── */

#toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 9999;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  font-size: 13px;
  color: var(--text-primary);
  min-width: 240px;
  animation: slideIn 0.2s ease;
}

.toast.success { border-color: rgba(74,222,128,0.3); }
.toast.error   { border-color: rgba(248,113,113,0.3); }

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

/* ── Loading spinner ─────────────────────────────────────── */

.spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--border-mid);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

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

/* ── Empty state ─────────────────────────────────────────── */

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}

.empty-state i { font-size: 32px; margin-bottom: 12px; display: block; }
.empty-state p { font-size: 14px; }

/* ── Scrollbar ───────────────────────────────────────────── */

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-mid); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }
