/* TypeFast Shared Styles */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #0a0a0f;
  --surface: #12121a;
  --surface-hover: #181824;
  --border: #1e1e2a;
  --text: #e8e8ed;
  --text-dim: #7a7a8e;
  --accent: #5cff95;
  --accent-glow: rgba(92, 255, 149, 0.15);
  --accent-dim: rgba(92, 255, 149, 0.08);
  --red: #ff5c5c;
  --red-dim: rgba(255, 92, 92, 0.12);
  --yellow: #ffd95c;
  --blue: #5c9eff;
}

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

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

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

/* ─── Layout ─────────────────────────── */
.app-nav {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 50;
}

.app-nav .logo {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--text);
  letter-spacing: -0.5px;
  text-decoration: none;
}

.app-nav .logo span { color: var(--accent); }

.app-nav .nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

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

.page-content {
  padding: 32px 24px;
  max-width: 1200px;
  margin: 0 auto;
}

/* ─── Buttons ────────────────────────── */
.btn {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: var(--bg);
}

.btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-1px);
  text-decoration: none;
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  border-color: var(--text-dim);
  background: var(--surface-hover);
  text-decoration: none;
}

.btn-danger {
  background: var(--red-dim);
  color: var(--red);
  border: 1px solid transparent;
}

.btn-danger:hover {
  border-color: var(--red);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.82rem;
}

.btn-icon {
  padding: 8px;
  min-width: 36px;
  justify-content: center;
}

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

/* ─── Cards ──────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  transition: border-color 0.2s;
}

.card:hover {
  border-color: var(--text-dim);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

/* ─── Forms/Inputs ───────────────────── */
.input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  padding: 10px 14px;
  border-radius: 8px;
  outline: none;
  transition: border-color 0.2s;
}

.input:focus {
  border-color: var(--accent);
}

.input::placeholder {
  color: var(--text-dim);
  opacity: 0.6;
}

textarea.input {
  resize: vertical;
  min-height: 80px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 6px;
  font-weight: 500;
}

/* ─── Badges ─────────────────────────── */
.badge {
  font-size: 0.75rem;
  padding: 3px 10px;
  border-radius: 12px;
  font-weight: 500;
}

.badge-green {
  background: var(--accent-glow);
  color: var(--accent);
}

.badge-red {
  background: var(--red-dim);
  color: var(--red);
}

.badge-dim {
  background: rgba(122, 122, 142, 0.15);
  color: var(--text-dim);
}

/* ─── Tables ─────────────────────────── */
.table-wrapper {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid var(--border);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  background: var(--surface);
  padding: 12px 16px;
  text-align: left;
  font-size: 0.8rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}

td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background: var(--surface);
}

/* ─── 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: 100;
  padding: 24px;
}

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 32px;
  max-width: 540px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
}

.modal h2 {
  font-size: 1.5rem;
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}

.modal p {
  color: var(--text-dim);
  margin-bottom: 24px;
}

/* ─── Empty State ────────────────────── */
.empty-state {
  text-align: center;
  padding: 80px 24px;
}

.empty-state .icon {
  font-size: 3rem;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state h3 {
  font-size: 1.3rem;
  margin-bottom: 8px;
}

.empty-state p {
  color: var(--text-dim);
  margin-bottom: 24px;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

/* ─── Toast ──────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 20px;
  font-size: 0.9rem;
  z-index: 200;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s ease;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast.success {
  border-color: var(--accent);
  color: var(--accent);
}

.toast.error {
  border-color: var(--red);
  color: var(--red);
}

/* ─── Loading ────────────────────────── */
.spinner {
  width: 20px;
  height: 20px;
  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;
  gap: 12px;
  padding: 48px;
  color: var(--text-dim);
}

/* ─── Responsive ─────────────────────── */
@media (max-width: 768px) {
  .card-grid {
    grid-template-columns: 1fr;
  }

  .page-content {
    padding: 20px 16px;
  }

  .app-nav {
    padding: 12px 16px;
  }

  .btn {
    padding: 8px 16px;
    font-size: 0.85rem;
  }
}
