/* Design tokens */
:root {
  --sp-color-primary: #2563eb;
  --sp-color-primary-hover: #1d4ed8;
  --sp-color-secondary: #6b7280;
  --sp-color-secondary-hover: #4b5563;
  --sp-color-danger: #dc2626;
  --sp-color-danger-hover: #b91c1c;
  --sp-color-success: #16a34a;
  --sp-color-warning: #d97706;
  --sp-color-muted: #9ca3af;

  --sp-color-bg: #ffffff;
  --sp-color-bg-secondary: #f9fafb;
  --sp-color-border: #e5e7eb;
  --sp-color-text: #111827;
  --sp-color-text-secondary: #6b7280;

  --sp-radius: 0.375rem;
  --sp-radius-lg: 0.5rem;
  --sp-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --sp-shadow-lg: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);

  --sp-font-size-sm: 0.875rem;
  --sp-font-size-base: 1rem;
  --sp-font-size-lg: 1.125rem;
  --sp-line-height: 1.5;

  --sp-sidebar-width: 220px;
  --sp-navbar-height: 56px;
}

/* Base resets */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: var(--sp-font-size-base);
  line-height: var(--sp-line-height);
  color: var(--sp-color-text);
  background-color: var(--sp-color-bg);
}

/* Layout shell */
.layout-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.layout-navbar {
  height: var(--sp-navbar-height);
  position: sticky;
  top: 0;
  z-index: 100;
}

.layout-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.layout-sidebar {
  width: var(--sp-sidebar-width);
  flex-shrink: 0;
  overflow-y: auto;
}

.layout-content {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
}

/* Auth shell */
.auth-shell {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background-color: var(--sp-color-bg-secondary);
}

.auth-card {
  width: 100%;
  max-width: 400px;
  padding: 2rem;
  background: var(--sp-color-bg);
  border-radius: var(--sp-radius-lg);
  box-shadow: var(--sp-shadow-lg);
}

/* Superadmin shell */
.superadmin-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Page header */
.page-header {
  margin-bottom: 1.5rem;
}

.page-header h1 {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0;
}

/* Utilities */
.text-muted {
  color: var(--sp-color-text-secondary);
}

.mt-auto {
  margin-top: auto;
}

/* Mobile layout: bottom padding for fixed tab-bar (<1200px) */
@media (max-width: 1199.98px) {
  .layout-content {
    padding-bottom: 72px;
  }
}

/* Search dropdown — visible only when HTMX injected content wrapper exists */
.c-search-dropdown { display: none; }
.c-search-dropdown:has(.c-search-dropdown__content) { display: block; }
