/* GoVektra — Notion/Linear Design System */
/* DM Sans + Indigo accent + Zinc grays */

* { box-sizing: border-box; }

/* ─── Labels & Inputs ─── */
.lbl { display: block; font-size: 13px; font-weight: 500; color: #52525b; margin-bottom: 4px; }

.fm-input {
  width: 100%; padding: 8px 12px;
  border: 1px solid #e4e4e7; border-radius: 8px;
  font-size: 13px; color: #18181b; background: #fff;
  outline: none; transition: all 0.15s ease;
}
.fm-input:focus { border-color: #818cf8; box-shadow: 0 0 0 3px rgba(99,102,241,0.1); }
.fm-input::placeholder { color: #a1a1aa; }

.fm-select {
  padding: 8px 12px; border: 1px solid #e4e4e7; border-radius: 8px;
  font-size: 13px; color: #18181b; background: #fff;
  outline: none; cursor: pointer; transition: all 0.15s;
  -webkit-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23a1a1aa' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
  padding-right: 32px;
}
.fm-select:focus { border-color: #818cf8; box-shadow: 0 0 0 3px rgba(99,102,241,0.1); }

/* ─── Buttons ─── */
.fm-btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 7px 14px; border-radius: 8px; font-size: 13px; font-weight: 500;
  color: #fff; background: #4f46e5; border: none; cursor: pointer;
  transition: all 0.15s; line-height: 1.4;
}
.fm-btn-primary:hover { background: #4338ca; }
.fm-btn-primary:active { transform: scale(0.98); }

.fm-btn-secondary {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 7px 14px; border-radius: 8px; font-size: 13px; font-weight: 500;
  color: #3f3f46; background: #fff; border: 1px solid #e4e4e7;
  cursor: pointer; transition: all 0.15s; line-height: 1.4;
}
.fm-btn-secondary:hover { background: #fafafa; border-color: #d4d4d8; }

.fm-btn-sm { padding: 5px 10px; font-size: 12px; }

.fm-btn-danger { display: inline-flex; align-items: center; gap: 4px; padding: 7px 14px; border-radius: 8px; font-size: 13px; font-weight: 500; color: #fff; background: #dc2626; border: none; cursor: pointer; }
.fm-btn-danger:hover { background: #b91c1c; }

/* ─── Sidebar ─── */
.nav-item {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px; border-radius: 6px;
  color: #52525b; font-size: 13px; font-weight: 450;
  cursor: pointer; transition: all 0.12s;
  text-decoration: none; user-select: none;
}
.nav-item:hover { background: #f4f4f5; color: #18181b; }
.nav-item.active { background: #fff; color: #18181b; font-weight: 550; box-shadow: 0 1px 2px rgba(0,0,0,0.04), 0 0 0 1px rgba(0,0,0,0.03); }
.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; opacity: 0.55; }
.nav-item.active svg { opacity: 0.85; }

.nav-section {
  padding: 6px 10px 4px; margin-top: 8px;
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.04em; color: #a1a1aa;
}

/* ─── Cards ─── */
.fm-card {
  background: #fff; border-radius: 10px;
  border: 1px solid #f4f4f5;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}
.fm-card-hover:hover { border-color: #e4e4e7; box-shadow: 0 2px 8px rgba(0,0,0,0.04); }

/* ─── Table ─── */
.fm-tbl { width: 100%; font-size: 13px; border-collapse: collapse; }
.fm-tbl thead th {
  text-align: left; padding: 10px 16px;
  font-size: 11px; font-weight: 600; color: #a1a1aa;
  text-transform: uppercase; letter-spacing: 0.04em;
  border-bottom: 1px solid #f4f4f5;
  background: transparent;
}
.fm-tbl tbody td { padding: 10px 16px; border-bottom: 1px solid #fafafa; }
.fm-tbl tbody tr { transition: background 0.1s; }
.fm-tbl tbody tr:hover { background: #fafafa; }
.fm-tbl tbody tr:last-child td { border-bottom: none; }

/* ─── Badges ─── */
.fm-badge {
  display: inline-flex; align-items: center; padding: 2px 8px;
  border-radius: 6px; font-size: 11px; font-weight: 600;
  line-height: 1.5;
}
.badge-blue { background: #eef2ff; color: #4f46e5; }
.badge-green { background: #ecfdf5; color: #059669; }
.badge-yellow { background: #fffbeb; color: #d97706; }
.badge-red { background: #fef2f2; color: #dc2626; }
.badge-gray { background: #f4f4f5; color: #71717a; }
.badge-purple { background: #faf5ff; color: #7c3aed; }

/* ─── Stats ─── */
.fm-stat {
  display: flex; align-items: center; gap: 14px; padding: 18px;
}
.fm-stat-icon {
  width: 40px; height: 40px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.fm-stat-val { font-size: 24px; font-weight: 700; line-height: 1.1; letter-spacing: -0.02em; }
.fm-stat-label { font-size: 12px; color: #a1a1aa; margin-top: 2px; }

/* ─── Action buttons (icon) ─── */
.fm-act {
  padding: 4px; border-radius: 6px; color: #a1a1aa;
  cursor: pointer; border: none; background: none;
  transition: all 0.12s; display: inline-flex; align-items: center;
}
.fm-act:hover { color: #4f46e5; background: #eef2ff; }
.fm-act-red:hover { color: #dc2626; background: #fef2f2; }
.fm-act-green:hover { color: #059669; background: #ecfdf5; }

/* ─── Toast ─── */
.fm-toast {
  padding: 10px 16px; border-radius: 10px; font-size: 13px; font-weight: 500;
  color: #fff; max-width: 340px;
  animation: toastIn 0.25s ease;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}
.toast-success { background: #18181b; }
.toast-error { background: #dc2626; }
@keyframes toastIn { from { transform: translateY(8px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ─── Loading ─── */
.fm-spinner {
  display: inline-block; width: 18px; height: 18px;
  border: 2px solid #e4e4e7; border-top-color: #4f46e5;
  border-radius: 50%; animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Monospace ─── */
.mono { font-family: 'DM Mono', ui-monospace, SFMono-Regular, monospace; font-variant-numeric: tabular-nums; }

/* ─── Page header ─── */
.fm-page-title { font-size: 20px; font-weight: 700; color: #18181b; letter-spacing: -0.02em; }
.fm-page-sub { font-size: 13px; color: #a1a1aa; margin-top: 2px; }

/* ─── Tabs ─── */
.fm-tab {
  padding: 8px 14px; font-size: 13px; font-weight: 500;
  color: #71717a; cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.12s;
}
.fm-tab:hover { color: #18181b; }
.fm-tab.active, .fm-tab.fm-tab-active { color: #4f46e5; border-color: #4f46e5; }

/* ─── Checkbox ─── */
.fm-checkbox {
  width: 16px; height: 16px; border-radius: 4px;
  border: 1.5px solid #d4d4d8; cursor: pointer;
  accent-color: #4f46e5; flex-shrink: 0;
}
.fm-checkbox:checked { border-color: #4f46e5; }

/* ─── Empty state ─── */
.fm-empty { text-align: center; padding: 48px 16px; color: #a1a1aa; font-size: 13px; }

/* ─── Divider ─── */
.fm-divider { height: 1px; background: #f4f4f5; margin: 16px 0; }

/* ─── Forms in cards ─── */
.fm-form-card {
  background: #fafafa; border-radius: 10px;
  border: 1px solid #f4f4f5; padding: 20px;
  margin-bottom: 16px;
}

/* ─── Responsive ─── */
@media (max-width: 1024px) {
  #sidebar { width: 220px; }
}
@media (max-width: 768px) {
  #sidebar { position: fixed; left: -260px; width: 260px; height: 100vh; z-index: 50; transition: left 0.25s ease; }
  #sidebar.open { left: 0; box-shadow: 0 0 40px rgba(0,0,0,0.2); }
  #page { padding: 16px 12px; margin-left: 0 !important; }
  .fm-page-title { font-size: 18px; }
  .fm-tbl thead th, .fm-tbl tbody td { padding: 8px 10px; }
  .fm-stat { padding: 12px; gap: 10px; }
  .fm-stat-val { font-size: 20px; }
  .fm-stat-icon { width: 36px; height: 36px; }
}
@media (max-width: 480px) {
  #page { padding: 12px 8px; }
  .fm-card { border-radius: 8px; }
  .fm-btn-primary, .fm-btn-secondary { padding: 8px 12px; font-size: 12px; }
}
