/* Floater Admin — Figma design tokens (Admin Panel prototype) */
:root {
  /* Exact stack from Floater Admin Panel theme.css */
  --font-family-sans: 'Inter', ui-sans-serif, system-ui, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
  --font-size: 16px;
  --font-size-body: 1rem;      /* 16px — Figma body / labels */
  --font-size-ui: 0.875rem;    /* 14px — Figma text-sm (tables, filters) */
  --font-size-title: 1.25rem;  /* 20px — Figma h2 / text-xl */
  --font-size-lg: 1.125rem;    /* 18px — Figma text-lg / h3 */
  --font-size-2xl: 1.5rem;     /* 24px — Figma text-2xl (stat values) */
  --font-size-xs: 0.75rem;     /* 12px */
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  --floater-red: #df1827;
  --floater-red-hover: #c41520;
  --floater-red-dark: #c4151f;
  --floater-ink: #0d0d0d;
  --floater-muted: #707070;
  --floater-line: #dfdfdf;
  --floater-border: #d7d7d7;
  --floater-soft: #fee2e2;
  --floater-bg: #f5f5f5;
  --floater-green: #16a34a;
  --floater-green-hover: #15803d;
  --floater-green-bg: #dcfce7;
  /* Approvals pending pill — Figma #FFF4E6 / #FF9800 */
  --floater-amber-bg: #FFF4E6;
  --floater-amber: #FF9800;
  --radius: 0.5rem;
}

html {
  font-size: var(--font-size);
  font-family: var(--font-family-sans);
}

html,
body,
body.admin-body {
  font-family: var(--font-family-sans);
  font-size: var(--font-size-body);
  font-weight: var(--font-weight-normal);
  line-height: 1.5;
  letter-spacing: 0;
  color: var(--floater-ink);
  background: #fff;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-synthesis: none;
}

/* Force Inter on all admin UI (every page — match Figma prototype) */
body.admin-body,
body.admin-body *,
body.admin-body input,
body.admin-body button,
body.admin-body select,
body.admin-body textarea,
body.admin-body table,
body.admin-body th,
body.admin-body td,
body.admin-body .dataTables_wrapper,
body.admin-body .dataTables_wrapper * {
  font-family: var(--font-family-sans) !important;
}

[x-cloak] { display: none !important; }

.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* Typography — Figma theme.css base (utilities like text-sm still win) */
.admin-page {
  font-size: var(--font-size-body);
  font-weight: var(--font-weight-normal);
  line-height: 1.5;
}

/* Detail/view field labels — slightly darker + slightly bolder; values unchanged */
.admin-detail-page label:not(.choose-file):not(:has(> input)):not(:has(> select)):not(:has(> textarea)) {
  font-weight: var(--font-weight-semibold) !important;
}

.admin-detail-page label[class*="text-[#0d0d0d]"]:not(.choose-file):not(:has(> input)):not(:has(> select)):not(:has(> textarea)),
.admin-detail-page label:not(.choose-file):not(:has(> input)):not(:has(> select)):not(:has(> textarea)):not([class*="text-[#707070]"]):not([class*="text-[#8c8c8c]"]):not([class*="text-[#df1827]"]) {
  color: #000000 !important;
}

.admin-detail-page label[class*="text-[#707070]"] {
  color: #4a4a4a !important;
}

.admin-page h1 {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-medium);
  line-height: 1.5;
  letter-spacing: 0;
  color: var(--floater-ink);
  margin: 0 0 0.5rem;
}

.admin-page h2,
.admin-page h2.page-title {
  font-size: var(--font-size-title);
  font-weight: var(--font-weight-medium);
  line-height: 1.5;
  letter-spacing: 0;
  color: var(--floater-ink);
  margin: 0 0 0.5rem;
}

.admin-page h3 {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-medium);
  line-height: 1.5;
  color: var(--floater-ink);
}

.admin-page h4 {
  font-size: var(--font-size-body);
  font-weight: var(--font-weight-medium);
  line-height: 1.5;
  color: var(--floater-ink);
}

.admin-page .page-subtitle {
  font-size: var(--font-size-body);
  font-weight: var(--font-weight-normal);
  line-height: 1.5;
  color: var(--floater-muted);
  margin: 0;
}

.admin-page label {
  font-size: var(--font-size-body);
  font-weight: var(--font-weight-medium);
  line-height: 1.5;
  color: var(--floater-ink);
}

/* Default control weight — size comes from Tailwind (text-sm) like Figma */
.admin-page button,
.admin-page .btn,
.admin-page a.btn {
  font-weight: var(--font-weight-medium);
  line-height: 1.5;
}

.admin-page input,
.admin-page select,
.admin-page textarea {
  font-weight: var(--font-weight-normal);
  line-height: 1.5;
}

/* Keep Figma size utilities consistent on every page */
.admin-page .text-xs { font-size: var(--font-size-xs) !important; line-height: 1.5; }
.admin-page .text-sm { font-size: var(--font-size-ui) !important; line-height: 1.5; }
.admin-page .text-base { font-size: var(--font-size-body) !important; line-height: 1.5; }
.admin-page .text-lg { font-size: var(--font-size-lg) !important; line-height: 1.5; }
.admin-page .text-xl { font-size: var(--font-size-title) !important; line-height: 1.5; }
.admin-page .text-2xl { font-size: var(--font-size-2xl) !important; line-height: 1.5; }

.admin-page .font-normal { font-weight: var(--font-weight-normal) !important; }
.admin-page .font-medium { font-weight: var(--font-weight-medium) !important; }
.admin-page .font-semibold { font-weight: var(--font-weight-semibold) !important; }
.admin-page .font-bold { font-weight: var(--font-weight-bold) !important; }

/* Dashboard / KPI cards — match Figma Dashboard.tsx */
.stat-card-value {
  color: var(--floater-ink);
  font-size: var(--font-size-2xl) !important;
  font-weight: var(--font-weight-semibold) !important;
  line-height: 1.5;
}
.stat-card-label {
  color: var(--floater-muted);
  font-size: var(--font-size-ui) !important;
  font-weight: var(--font-weight-normal) !important;
  line-height: 1.5;
}
.stat-card-subtitle {
  color: var(--floater-red);
  font-size: var(--font-size-xs) !important;
  font-weight: var(--font-weight-normal) !important;
  line-height: 1.5;
  margin-top: 0.25rem;
}

/* Global Settings / admin form helpers (Figma layout) */
.admin-form-card {
  background: #fff;
  border: 1px solid var(--floater-line);
  border-radius: 0.5rem;
  padding: 1.5rem;
}
.admin-form-grid-3 {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 1.5rem;
}
@media (min-width: 768px) {
  .admin-form-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.admin-form-dropzone {
  border: 2px dashed var(--floater-border);
  border-radius: 0.5rem;
  padding: 2rem;
  text-align: center;
  background: #fff;
}
.admin-form-dropzone label.choose-file {
  color: var(--floater-red);
  cursor: pointer;
  text-decoration: none;
}
.admin-form-dropzone label.choose-file:hover { text-decoration: underline; }
.admin-form-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-top: 1rem;
}

/* Form controls */
.admin-input,
.admin-select,
.admin-textarea {
  border: 1px solid var(--floater-border);
  border-radius: var(--radius);
  color: var(--floater-ink);
  background: #fff;
  padding: 0.5rem 0.75rem;
  font-size: var(--font-size-body);
  font-weight: 400;
  line-height: 1.5;
  outline: none;
  transition: box-shadow .15s, border-color .15s;
}
.admin-input:focus,
.admin-select:focus,
.admin-textarea:focus {
  box-shadow: 0 0 0 2px var(--floater-red);
}

.admin-select {
  appearance: none;
  background-image: none;
  cursor: pointer;
  padding-right: 2.5rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  font-size: var(--font-size-body);
  font-weight: 500;
  line-height: 1.5;
  transition: background-color .15s, opacity .15s, color .15s;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
}
.btn-primary { background: var(--floater-red); color: #fff; }
.btn-primary:hover { background: var(--floater-red-hover); }
.btn-success { background: var(--floater-green); color: #fff; }
.btn-success:hover { background: var(--floater-green-hover); }
.btn-outline {
  background: #fff;
  color: var(--floater-ink);
  border-color: var(--floater-border);
}
.btn-outline:hover { background: var(--floater-bg); }
.btn-lg { padding: 0.5rem 1.5rem; }

/* Status pills — Figma rounded-full px-3 py-1 text-xs */
.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1.25;
  text-transform: capitalize;
}
.status-pill--active,
.status-pill--approved,
.status-pill--verified,
.status-pill--sent,
.status-pill--delivered { background: #E8F5E9; color: #4CAF50; }
/* Figma Sports/Users: Inactive uses soft red */
.status-pill--inactive,
.status-pill--draft { background: #fee2e2; color: #dc2626; }
.status-pill--pending,
.status-pill--scheduled { background: var(--floater-amber-bg); color: var(--floater-amber); }
.status-pill--resubmit { background: #FFEBEE; color: #F44336; }
.status-pill--blocked,
.status-pill--rejected,
.status-pill--failed { background: var(--floater-soft); color: #dc2626; }
.status-pill--signed-up { background: #fef3c7; color: #d97706; }
.status-pill--booked { background: #dbeafe; color: #2563eb; }
.status-pill--category-vendor { background: #fef3c7; color: #d97706; }
.status-pill--category-trainer { background: #dbeafe; color: #2563eb; }
.status-pill--category-user { background: #d1fae5; color: #065f46; }
.status-pill--captured { background: #dcfce7; color: #15803d; }
.status-pill--refunded { background: #dbeafe; color: #2563eb; }

/* Data table — Figma bordered rounded container */
.admin-table-wrap {
  border: 1px solid var(--floater-line);
  border-radius: 0.5rem;
  overflow: hidden;
  overflow-x: auto;
  background: #fff;
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  caption-side: bottom;
}
.admin-table thead tr { border-bottom: 1px solid var(--floater-line); }
.admin-table th {
  height: 3rem;
  padding: 0.5rem 0.75rem;
  text-align: left;
  vertical-align: middle;
  font-weight: 600;
  color: var(--floater-ink);
  white-space: nowrap;
  background: #fff;
}
.admin-table td {
  height: 3rem;
  padding: 0.5rem 0.75rem;
  vertical-align: middle;
  white-space: nowrap;
  color: var(--floater-ink);
  border-bottom: 1px solid var(--floater-line);
}
.admin-table tbody tr:last-child td { border-bottom: 0; }
.admin-table tbody tr:hover { background: rgba(0,0,0,0.02); }

/* Icon action button */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  border-radius: var(--radius);
  transition: background .15s;
  color: var(--floater-red);
}
.icon-btn:hover { background: var(--floater-bg); }
.icon-btn--muted { color: var(--floater-muted); }

/* Clickable entity IDs: same color as table text (Figma); only hover shows clickable */
a.admin-id-link,
a.admin-id-link:link,
a.admin-id-link:visited,
a.admin-id-link:hover,
a.admin-id-link:focus,
a.admin-id-link:active {
  color: var(--floater-ink);
  font-weight: inherit;
  text-decoration: none;
  cursor: pointer;
}
a.admin-id-link:hover,
a.admin-id-link:focus {
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Flash */
.flash {
  margin: 0 0 1rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
}
.flash-success { background: var(--floater-green-bg); color: #166534; }
.flash-error { background: var(--floater-soft); color: #991b1b; }

/* Pagination */
.admin-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1rem;
  gap: 1rem;
  flex-wrap: wrap;
}
.admin-pagination p { font-size: 0.875rem; color: var(--floater-muted); margin: 0; }
.admin-pagination .pager { display: flex; gap: 0.5rem; }
.admin-pagination a,
.admin-pagination span.disabled {
  display: inline-flex;
  padding: 0.5rem 1rem;
  border: 1px solid var(--floater-line);
  border-radius: var(--radius);
  color: var(--floater-ink);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
}
.admin-pagination a:hover { background: var(--floater-bg); }
.admin-pagination span.disabled { opacity: 0.5; cursor: not-allowed; }

/* Actions dropdown — height follows content; never scroll internally */
.actions-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  width: 12rem;
  height: auto;
  max-height: none;
  overflow: visible;
  background: #fff;
  border: 1px solid var(--floater-line);
  border-radius: var(--radius);
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  z-index: 80;
  padding: 0.25rem 0;
}
.actions-menu.is-fixed {
  position: fixed;
  right: auto;
}
.actions-menu form {
  display: block;
  margin: 0;
  width: 100%;
}
.actions-menu button,
.actions-menu a {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  color: var(--floater-ink);
  text-align: left;
  background: transparent;
  border: 0;
  cursor: pointer;
  text-decoration: none;
}
.actions-menu button:hover,
.actions-menu a:hover { background: var(--floater-bg); }
.actions-menu button.actions-menu__danger,
.actions-menu a.actions-menu__danger {
  color: #df1827;
}
.actions-menu button.actions-menu__danger:hover,
.actions-menu a.actions-menu__danger:hover {
  background: #fef2f2;
}

/* Sidebar nav helpers */
.nav-link {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  color: var(--floater-ink);
  text-decoration: none;
  transition: background .15s, color .15s;
  font-size: var(--font-size-body);
  font-weight: 400;
  line-height: 1.5;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
}
.nav-link:hover { background: var(--floater-bg); }
.nav-link.is-active { background: var(--floater-red); color: #fff; }
.nav-sub {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  color: var(--floater-muted);
  text-decoration: none;
  font-size: 0.875rem;
  transition: background .15s, color .15s;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
}
.nav-sub:hover { background: var(--floater-bg); }
.nav-sub.is-active { background: var(--floater-soft); color: var(--floater-red); }
.nav-nested {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.75rem;
  border-radius: var(--radius);
  color: var(--floater-muted);
  text-decoration: none;
  font-size: 0.75rem;
  transition: background .15s, color .15s;
}
.nav-nested:hover { background: var(--floater-bg); }
.nav-nested.is-active { background: var(--floater-soft); color: var(--floater-red); }

.lucide { width: 1.25rem; height: 1.25rem; flex-shrink: 0; stroke-width: 2; }
.lucide-sm { width: 1rem; height: 1rem; }
.lucide-xs { width: 0.75rem; height: 0.75rem; }
