/* ══════════════════════════════════════
   MOMENTUM DIGITAL — DESIGN SYSTEM
   ══════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:wght@500&display=swap');

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

:root {
  --bg: #0F0F12;
  --bg-raised: #16161B;
  --bg-card: #1C1C23;
  --bg-input: #23232B;
  --border: rgba(255,255,255,0.06);
  --border-md: rgba(255,255,255,0.10);
  --border-focus: #D42B2B;
  --text: #F4F4F5;
  --text-secondary: #A1A1AA;
  --text-muted: #71717A;
  --green: #10B981;
  --green-bg: rgba(16,185,129,0.12);
  --purple: #D42B2B;
  --purple-bg: rgba(212,43,43,0.12);
  --red: #EF4444;
  --red-bg: rgba(239,68,68,0.12);
  --blue: #3B82F6;
  --amber: #F59E0B;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --shadow: 0 4px 24px rgba(0,0,0,0.3);
  --font: 'Plus Jakarta Sans', system-ui, sans-serif;
  --mono: 'JetBrains Mono', monospace;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── ANIMATIONS ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── BUTTONS ── */
.btn {
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}
.btn-primary {
  background: var(--purple);
  color: white;
}
.btn-primary:hover { background: #7C3AED; transform: translateY(-1px); }
.btn-danger {
  background: var(--red-bg);
  color: var(--red);
}
.btn-danger:hover { background: rgba(239,68,68,0.2); }
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-md);
}
.btn-ghost:hover { background: var(--bg-card); color: var(--text); }
.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-icon {
  width: 36px; height: 36px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}
.btn-icon:hover { background: var(--bg-card); color: var(--text); border-color: var(--border-md); }

/* ── INPUTS ── */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}
.form-input, .form-select {
  font-family: var(--font);
  width: 100%;
  padding: 10px 14px;
  font-size: 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-md);
  border-radius: var(--radius-sm);
  color: var(--text);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-input:focus, .form-select:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(139,92,246,0.15);
}
.form-input::placeholder { color: var(--text-muted); }

/* ── CARDS ── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  transition: all 0.2s;
}
.card:hover {
  border-color: var(--border-md);
  box-shadow: 0 2px 12px rgba(0,0,0,0.2);
}

/* ── TABLE ── */
.table-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.table-wrap table {
  width: 100%;
  border-collapse: collapse;
}
.table-wrap th {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: 12px 16px;
  text-align: left;
  background: var(--bg-raised);
  border-bottom: 1px solid var(--border);
}
.table-wrap td {
  font-size: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
}
.table-wrap tr:last-child td { border-bottom: none; }
.table-wrap tr:hover td { background: var(--bg-raised); }

/* ── BADGES ── */
.badge-active {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  background: var(--green-bg);
  color: var(--green);
}
.badge-inactive {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  background: var(--red-bg);
  color: var(--red);
}

/* ── TOAST ── */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: white;
  z-index: 9999;
  animation: slideDown 0.3s ease;
  box-shadow: var(--shadow);
}
.toast.success { background: #065F46; }
.toast.error { background: #991B1B; }

/* ── MODAL ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.2s ease;
}
.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-md);
  border-radius: var(--radius-lg);
  padding: 2rem;
  width: 90%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  animation: fadeUp 0.3s cubic-bezier(0.22,1,0.36,1);
}
.modal-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 1.5rem;
  letter-spacing: -0.02em;
}
.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 1.5rem;
}

/* ── EMPTY STATE ── */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--text-muted);
}
.empty-state svg {
  width: 48px;
  height: 48px;
  margin-bottom: 12px;
  opacity: 0.4;
}
.empty-state h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.empty-state p {
  font-size: 14px;
  margin-bottom: 16px;
}

/* ── LOADING ── */
.spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--border-md);
  border-top-color: var(--purple);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
.loading-full {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
}

/* ── LAYOUT ── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: var(--bg-raised);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.topbar-brand {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
}
.topbar-brand-dot {
  width: 8px; height: 8px;
  background: var(--purple);
  border-radius: 50%;
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.topbar-user {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}

.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 12px;
}
.page-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.03em;
}
.page-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ── CLIENT GRID ── */
.client-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}
.client-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.client-card:hover {
  border-color: var(--purple);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(139,92,246,0.1);
}
.client-card-top {
  display: flex;
  align-items: center;
  gap: 12px;
}
.client-card-logo {
  width: 44px; height: 44px;
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.client-card-logo img {
  width: 100%; height: 100%; object-fit: contain;
}
.client-card-name {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.client-card-slug {
  font-size: 12px;
  color: var(--text-muted);
  font-family: var(--mono);
}
.client-card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.client-card-actions {
  display: flex;
  gap: 6px;
}

/* ── FILE INPUT ── */
.file-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
}
.file-input-wrap input[type="file"] {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}
.file-input-label {
  font-size: 13px;
  padding: 8px 16px;
  border: 1px dashed var(--border-md);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  width: 100%;
}
.file-input-label:hover {
  border-color: var(--purple);
  color: var(--text-secondary);
}
.file-preview {
  width: 40px; height: 40px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.file-preview img { width: 100%; height: 100%; object-fit: contain; }

/* ── RESPONSIVE ── */
@media (max-width: 640px) {
  .container { padding: 1.25rem 1rem; }
  .page-title { font-size: 18px; }
  .page-header { flex-direction: column; align-items: flex-start; }
  .client-grid { grid-template-columns: 1fr; }
  .topbar { padding: 12px 16px; }
  .topbar-user { display: none; }
  .modal { padding: 1.5rem; margin: 1rem; }
  .table-wrap { overflow-x: auto; }
}
