/* Bazara App Styles — matches landing page design system */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=DM+Sans:wght@400;500&display=swap');

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

:root {
  --bg: #06060b;
  --surface: #0e0e16;
  --surface-hover: #141422;
  --border: #1a1a2e;
  --border-light: #252540;
  --text: #e8e8ed;
  --text-dim: #8888a0;
  --text-muted: #55556a;
  --accent: #f5a623;
  --accent-glow: rgba(245, 166, 35, 0.15);
  --accent-hover: #fbb540;
  --green: #34d399;
  --green-dim: rgba(52, 211, 153, 0.15);
  --red: #f87171;
  --red-dim: rgba(248, 113, 113, 0.15);
  --blue: #60a5fa;
  --blue-dim: rgba(96, 165, 250, 0.15);
  --radius: 12px;
  --radius-sm: 8px;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  line-height: 1.6;
  min-height: 100vh;
}

h1, h2, h3, h4 {
  font-family: 'Space Grotesk', sans-serif;
  line-height: 1.2;
}

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

/* -- NAV -- */
.app-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(6,6,11,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.app-nav .logo {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--accent);
  letter-spacing: -0.5px;
}
.app-nav .logo-dot { color: var(--text-dim); }
.app-nav .nav-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.app-nav .user-email {
  color: var(--text-dim);
  font-size: 0.85rem;
}
.app-nav .nav-link {
  color: var(--text-dim);
  font-size: 0.85rem;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  transition: all 0.2s;
}
.app-nav .nav-link:hover {
  color: var(--text);
  background: var(--surface);
}
.app-nav .nav-link.active {
  color: var(--accent);
  background: var(--accent-glow);
}

/* -- BUTTONS -- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-sm);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.btn-primary {
  background: var(--accent);
  color: #000;
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { border-color: var(--border-light); background: var(--surface-hover); }
.btn-danger {
  background: var(--red-dim);
  color: var(--red);
  border: 1px solid transparent;
}
.btn-danger:hover { border-color: var(--red); }
.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.8rem; }
.btn-ghost {
  background: transparent;
  color: var(--text-dim);
  border: 1px solid transparent;
  padding: 0.4rem 0.8rem;
  font-size: 0.8rem;
}
.btn-ghost:hover { color: var(--text); background: var(--surface); }

/* -- FORMS -- */
.form-group {
  margin-bottom: 1.25rem;
}
.form-group label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 0.4rem;
  font-family: 'Space Grotesk', sans-serif;
}
.form-input {
  width: 100%;
  padding: 0.7rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  transition: border-color 0.2s;
  outline: none;
}
.form-input:focus {
  border-color: var(--accent);
}
.form-input::placeholder {
  color: var(--text-muted);
}
select.form-input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%238888a0' fill='none' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

/* -- CARDS -- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.card-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1rem;
  font-weight: 600;
}

/* -- STAT CARDS -- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}
.stat-card .stat-label {
  font-size: 0.8rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-family: 'Space Grotesk', sans-serif;
  margin-bottom: 0.5rem;
}
.stat-card .stat-value {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.8rem;
  font-weight: 700;
}
.stat-card .stat-sub {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-top: 0.25rem;
}

/* -- LAYOUT -- */
.app-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 5rem 2rem 3rem;
}
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
}
.page-title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

/* -- AUTH PAGES -- */
.auth-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}
.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2.5rem;
  width: 100%;
  max-width: 420px;
}
.auth-card h1 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  letter-spacing: -0.5px;
}
.auth-card .subtitle {
  color: var(--text-dim);
  margin-bottom: 2rem;
  font-size: 0.95rem;
}
.auth-card .auth-footer {
  text-align: center;
  margin-top: 1.5rem;
  color: var(--text-dim);
  font-size: 0.9rem;
}
.auth-card .error-msg {
  background: var(--red-dim);
  color: var(--red);
  padding: 0.7rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  margin-bottom: 1rem;
  display: none;
}
.auth-card .error-msg.visible { display: block; }

/* -- TABLES -- */
.data-table {
  width: 100%;
  border-collapse: collapse;
}
.data-table th {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dim);
  text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
}
.data-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
  vertical-align: middle;
}
.data-table tr:hover td {
  background: var(--surface-hover);
}

/* -- BADGES -- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: 'Space Grotesk', sans-serif;
}
.badge-green { background: var(--green-dim); color: var(--green); }
.badge-red { background: var(--red-dim); color: var(--red); }
.badge-blue { background: var(--blue-dim); color: var(--blue); }
.badge-amber { background: var(--accent-glow); color: var(--accent); }
.badge-dim { background: rgba(136,136,160,0.1); color: var(--text-dim); }

/* -- CHANGE INDICATORS -- */
.change-up { color: var(--green); }
.change-down { color: var(--red); }
.change-neutral { color: var(--text-dim); }

/* -- ALERTS LIST -- */
.alert-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  transition: background 0.2s;
}
.alert-item:hover { background: var(--surface-hover); }
.alert-item.unread { border-left: 3px solid var(--accent); }
.alert-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 6px;
  flex-shrink: 0;
}
.alert-dot.high { background: var(--red); }
.alert-dot.medium { background: var(--accent); }
.alert-dot.info { background: var(--blue); }
.alert-title { font-weight: 500; font-size: 0.9rem; }
.alert-message { color: var(--text-dim); font-size: 0.8rem; margin-top: 2px; }
.alert-time { color: var(--text-muted); font-size: 0.75rem; margin-top: 4px; }

/* -- REPORT VIEW -- */
.report-summary {
  white-space: pre-line;
  line-height: 1.8;
  color: var(--text);
  font-size: 0.95rem;
}
.report-meta {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  color: var(--text-dim);
  font-size: 0.85rem;
}

/* -- EMPTY STATE -- */
.empty-state {
  text-align: center;
  padding: 3rem 2rem;
  color: var(--text-dim);
}
.empty-state .empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}
.empty-state h3 {
  color: var(--text);
  margin-bottom: 0.5rem;
}
.empty-state p {
  max-width: 400px;
  margin: 0 auto 1.5rem;
  font-size: 0.9rem;
}

/* -- LOADING -- */
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  color: var(--text-dim);
  gap: 0.75rem;
}

/* -- GRID -- */
.grid-2 {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
}

/* -- TABS -- */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
}
.tab {
  padding: 0.75rem 1.25rem;
  font-size: 0.9rem;
  color: var(--text-dim);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  font-family: 'Space Grotesk', sans-serif;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* -- RESPONSIVE -- */
@media (max-width: 768px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
  .app-nav { padding: 0.75rem 1.25rem; }
  .app-container { padding: 4.5rem 1.25rem 2rem; }
  .page-header { flex-direction: column; align-items: flex-start; gap: 1rem; }
  .data-table { font-size: 0.8rem; }
  .data-table th, .data-table td { padding: 0.6rem 0.5rem; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .auth-card { padding: 1.5rem; }
}

/* Utility */
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.text-dim { color: var(--text-dim); }
.text-sm { font-size: 0.85rem; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.hidden { display: none; }
.mono { font-family: 'SF Mono', 'Fira Code', monospace; }
