/* TaglusOS Distributor Command Center — dashboard styles */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0A1628;
  --surface: #0F1E35;
  --surface2: #142440;
  --accent: #F5A623;
  --accent-dim: rgba(245, 166, 35, 0.12);
  --accent-border: rgba(245, 166, 35, 0.2);
  --text: #E8EFF7;
  --text-muted: #7A92B0;
  --border: rgba(245, 166, 35, 0.12);
  --white: #FAFCFF;
  --font-display: 'Syne', sans-serif;
  --font-body: 'DM Sans', sans-serif;
  --green: #34c759;
  --yellow: #f5c518;
  --orange: #ff8c42;
  --red: #ff4757;
  --gray: #8892a4;
  --blue: #4f8ef7;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

/* Nav */
.topnav {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0 32px;
  height: 56px;
  background: rgba(10, 22, 40, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-brand {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 18px;
  color: var(--white);
  margin-right: 32px;
  letter-spacing: -0.02em;
  text-decoration: none;
}
.nav-links { display: flex; gap: 4px; }
.nav-link {
  padding: 6px 14px;
  border-radius: 6px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s;
}
.nav-link:hover, .nav-link.active { background: var(--surface2); color: var(--text); }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.last-updated { font-size: 12px; color: var(--text-muted); }
.btn-refresh {
  padding: 6px 14px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  font-family: var(--font-body);
}
.btn-refresh:hover { color: var(--accent); border-color: var(--accent); }

/* Container */
.container { max-width: 1200px; margin: 0 auto; padding: 28px 24px; }

/* Sections */
.section h1 { font-size: 22px; font-weight: 700; margin-bottom: 20px; }
.section.hidden { display: none; }

/* Stat Cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px 16px;
  text-align: center;
}
.stat-card.neutral { border-color: var(--accent-border); }
.stat-number { font-size: 32px; font-weight: 700; line-height: 1; margin-bottom: 6px; font-family: var(--font-display); }
.stat-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; font-weight: 500; }

#stat-new .stat-number { color: var(--blue); }
#stat-contacted .stat-number { color: var(--yellow); }
#stat-negotiating .stat-number { color: var(--orange); }
#stat-onboarded .stat-number { color: var(--green); }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 20px; margin-bottom: 20px; }
.card h2 { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 16px; font-family: var(--font-display); }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.card-header h1, .card-header h2 { margin-bottom: 0; }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.6px; padding: 8px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 10px 12px; border-bottom: 1px solid rgba(245,166,35,0.06); font-size: 13px; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--surface2); }
td.empty { text-align: center; color: var(--text-muted); padding: 24px; font-style: italic; }

/* Badges */
.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: capitalize;
  letter-spacing: 0.3px;
}
.badge-blue { background: rgba(79,142,247,0.15); color: var(--blue); }
.badge-yellow { background: rgba(245,197,24,0.15); color: var(--yellow); }
.badge-orange { background: rgba(255,140,66,0.15); color: var(--orange); }
.badge-green { background: rgba(52,199,89,0.15); color: var(--green); }
.badge-gray { background: rgba(122,128,153,0.15); color: var(--gray); }

/* Buttons */
.btn-primary {
  padding: 8px 16px;
  background: var(--accent);
  color: #0A1628;
  border: none;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  font-family: var(--font-body);
}
.btn-primary:hover { background: #d4900e; }
.btn-icon {
  padding: 4px 8px;
  border-radius: 5px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 12px;
}
.btn-icon:hover { color: var(--accent); border-color: var(--accent); }
.btn-icon.btn-danger:hover { color: var(--red); border-color: var(--red); }
.btn-full { width: 100%; }

/* Filters */
.filters-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  align-items: center;
}
.filters-bar input, .filters-bar select {
  padding: 8px 12px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-family: var(--font-body);
}
.filters-bar input { flex: 1; }
.filters-bar input::placeholder { color: var(--text-muted); }
.filters-bar select option { background: var(--surface2); }

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal.hidden { display: none; }
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
}
.modal-box {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.modal-header h2 { font-size: 18px; font-weight: 700; }
.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
}
.modal-close:hover { color: var(--text); }

/* Forms */
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  font-size: 14px;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.form-group textarea { resize: vertical; }

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

@media (max-width: 768px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .filters-bar { flex-wrap: wrap; }
  .topnav { padding: 0 16px; }
  .container { padding: 16px; }
}