/**
 * BASECAMP COMPONENTS — Organic UI
 * =================================
 * 
 * All component styles for the Basecamp platform.
 * Uses tokens from tokens.css.
 * 
 * Sections:
 * 1. Layout (App Shell, Sidebar, Topbar)
 * 2. Navigation
 * 3. Typography Components
 * 4. Buttons
 * 5. Forms
 * 6. Cards
 * 7. Tables
 * 8. Badges & Status
 * 9. Alerts & Feedback
 * 10. Modals & Overlays
 * 11. Utilities
 */

/* ============================================================================
   1. LAYOUT — App Shell (Soft Glass Dashboard)
   ============================================================================ */

.app-layout {
  display: flex;
  min-height: 100vh;
  background: var(--canvas-bg);
  position: relative;
}

/* Canvas gradient atmosphere layer */
.app-layout::before {
  content: '';
  position: fixed;
  inset: 0;
  background: var(--canvas-gradient);
  pointer-events: none;
  z-index: -1; /* Ensure it stays behind all content */
  z-index: 0;
}

/* --- Sidebar --- */

.app-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  padding-top: var(--topbar-height);
  display: flex;
  flex-direction: column;
  z-index: calc(var(--z-sticky) - 1);
  transition: transform var(--duration-normal) var(--ease-out);
  overflow: hidden;
}



.sidebar-header {
  padding: var(--space-5) var(--space-5);
  border-bottom: 1px solid var(--border-muted);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  color: var(--fg-default);
}

.sidebar-logo-icon {
  width: 32px;
  height: 32px;
  background: var(--accent);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--fg-on-accent);
  font-weight: var(--weight-semibold);
  font-size: var(--text-sm);
}

.sidebar-logo-text {
  font-size: var(--text-lg);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-tight);
}

.sidebar-logo-text span {
  color: var(--accent);
}

.sidebar-nav {
  position: relative; /* For nav-follower positioning */
  flex: 1;
  padding: var(--space-2); /* Gap to sidebar edge - symmetric left/right */
  padding-top: 20px;
  overflow-y: auto;
}

.sidebar-footer {
  padding: var(--space-4);
  border-top: 1px solid var(--border-muted);
}

/* --- Main Content Area --- */

.app-main {
  flex: 1;
  margin-left: 0;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - var(--topbar-height, 60px));
  position: relative;
  z-index: 1; /* Above canvas layer */
  padding-top: var(--topbar-height, 60px);
}

/* --- Topbar (Frosted Glass) --- */

.topbar {
  position: sticky;
  top: 0;
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-6);
  gap: var(--space-4);
  z-index: var(--z-header);
  background: transparent;
  border-bottom: 1px solid transparent;
  
  /* Scroll depth transition */
  transition: 
    border-color var(--duration-normal) var(--ease-out),
    box-shadow var(--duration-normal) var(--ease-out);
}

/* Topbar scroll depth state — shows glass effect when scrolled */
.topbar.is-scrolled {
  background: var(--glass-bg-topbar);
  border-bottom-color: var(--glass-border);
  box-shadow: var(--shadow-card);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
}

@media (prefers-reduced-motion: reduce) {
  .topbar {
    transition: none;
  }
}

/* Fallback for browsers without backdrop-filter (Safari check) */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .topbar {
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-default);
  }
}

.topbar-left,
.topbar-right {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.topbar-center {
  flex: 1;
  display: flex;
  justify-content: center;
  max-width: 480px;
}

/* --- Content Area --- */

.app-content {
  flex: 1;
  padding: var(--space-6) var(--space-8);
  padding-bottom: var(--space-12);
  width: 100%;
  /* No max-width — responsive full-width layout */
}

/* ============================================================================
   2. NAVIGATION
   ============================================================================ */

.nav-section {
  margin-bottom: var(--space-6);
}

.nav-label {
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  text-transform: uppercase;
  letter-spacing: var(--tracking-caps);
  color: var(--fg-subtle);
  padding: var(--space-2) var(--space-3);
  margin-bottom: var(--space-1);
}

/* Living UI: Nav items with organic hover */
.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2\.5) var(--space-3);
  color: var(--fg-muted);
  text-decoration: none;
  font-size: var(--text-sm);
  font-weight: var(--weight-normal);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-1);
  transition: color var(--duration-fast) var(--ease-out);
  z-index: 1;
}

/* --- Nav Follower (P12.4) — Gliding intent highlight --- */
.nav-follower {
  position: absolute;
  left: var(--space-2);
  right: var(--space-2);
  top: 0;
  height: 40px;
  background: var(--nav-follower-bg);
  border: 1px solid var(--nav-follower-border);
  border-radius: var(--radius-lg);
  opacity: 0;
  pointer-events: none;
  z-index: 0;
  transition: 
    top var(--nav-follower-duration) var(--motion-ease-emphasized),
    height var(--nav-follower-duration) var(--motion-ease-emphasized),
    opacity var(--duration-fast) var(--ease-out);
  will-change: top, opacity;
}

.nav-follower.is-visible {
  opacity: 1;
}

/* First activation — skip transition */
.nav-follower.no-transition {
  transition: none !important;
}

/* Disable follower animation on reduced motion */
@media (prefers-reduced-motion: reduce) {
  .nav-follower {
    display: none;
  }
}

/* Nav item hover — only used when no JS follower */
.nav-item:hover {
  color: var(--fg-default);
}

/* Fallback background for no-JS or reduced motion */
@media (prefers-reduced-motion: reduce) {
  .nav-item::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: var(--bg-subtle);
    opacity: 0;
    z-index: -1;
  }
  
  .nav-item:hover::before {
    opacity: 1;
  }
}

/* Slow afterglow on leave */
.nav-item:not(:hover)::before {
  transition:
    opacity var(--duration-slow) var(--ease-out),
    transform var(--duration-slow) var(--ease-out);
}

/* Active state */
.nav-item.active {
  color: var(--fg-default);
  font-weight: var(--weight-medium);
}

.nav-item.active::before {
  opacity: 1;
  transform: scale(1);
  background: var(--bg-subtle);
}

/* Sidebar-specific nav items — dark grey instead of accent */
.app-sidebar .nav-item {
  color: var(--fg-muted);
}

.app-sidebar .nav-item:hover {
  color: var(--fg-default);
}

.app-sidebar .nav-item.active {
  color: var(--fg-default);
  background: var(--bg-subtle);
  border-radius: var(--radius-lg);
}

/* Nav icons */
.nav-item svg,
/* --- Icon System (P12.5) — Modern Line Icons --- */
/* 
 * Design principle: smaller icons = thicker strokes, larger icons = thinner strokes
 * This creates visual balance and a modern, refined aesthetic.
 */

/* Icon size classes with proportional stroke weights */
.icon-xs {
  width: var(--icon-size-xs);
  height: var(--icon-size-xs);
}
.icon-xs,
.icon-xs path,
.icon-xs line,
.icon-xs circle,
.icon-xs polyline,
.icon-xs rect {
  stroke-width: var(--icon-stroke-xs) !important;
}

.icon-sm {
  width: var(--icon-size-sm);
  height: var(--icon-size-sm);
}
.icon-sm,
.icon-sm path,
.icon-sm line,
.icon-sm circle,
.icon-sm polyline,
.icon-sm rect {
  stroke-width: var(--icon-stroke-sm) !important;
}

.icon-md {
  width: var(--icon-size-md);
  height: var(--icon-size-md);
}
.icon-md,
.icon-md path,
.icon-md line,
.icon-md circle,
.icon-md polyline,
.icon-md rect {
  stroke-width: var(--icon-stroke-md) !important;
}

.icon-lg {
  width: var(--icon-size-lg);
  height: var(--icon-size-lg);
}
.icon-lg,
.icon-lg path,
.icon-lg line,
.icon-lg circle,
.icon-lg polyline,
.icon-lg rect {
  stroke-width: var(--icon-stroke-lg) !important;
}

.icon-xl {
  width: var(--icon-size-xl);
  height: var(--icon-size-xl);
}
.icon-xl,
.icon-xl path,
.icon-xl line,
.icon-xl circle,
.icon-xl polyline,
.icon-xl rect {
  stroke-width: var(--icon-stroke-xl) !important;
}

/* Nav icons — balanced weight for readability */
.nav-icon {
  width: var(--icon-size-md);
  height: var(--icon-size-md);
}
.nav-icon,
.nav-icon path,
.nav-icon line,
.nav-icon circle,
.nav-icon polyline,
.nav-icon rect {
  stroke-width: var(--icon-stroke-sm) !important; /* 1.75 - balanced with text */
}

/* Nav icon specific styling */
.nav-item .nav-icon {
  opacity: 0.7;
  flex-shrink: 0;
  transition: opacity var(--duration-fast) var(--ease-out);
}

.nav-item:hover svg,
.nav-item:hover .nav-icon,
.nav-item.active svg,
.nav-item.active .nav-icon {
  opacity: 1;
}

/* Nav empty state */
.nav-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-8) var(--space-4);
  text-align: center;
  color: var(--fg-subtle);
}

.nav-empty-state svg {
  opacity: 0.3;
  width: 48px;
  height: 48px;
}

/* ============================================================================
   3. TYPOGRAPHY COMPONENTS
   ============================================================================ */

/* Page Header */
.page-header {
  margin-bottom: var(--space-20); /* 80px - breathing room between header and content */
}

.page-title {
  font-size: var(--text-3xl);
  font-weight: var(--weight-light);
  letter-spacing: var(--tracking-tight);
  color: var(--fg-default);
  margin-bottom: var(--space-2);
}

.page-subtitle {
  font-size: var(--text-base);
  color: var(--fg-muted);
  max-width: 60ch;
  margin-bottom: var(--space-10); /* 40px - breathing room to content */
}

/* --- Dashboard Composition (P12.3) --- */

/* Hero Header — Large greeting with subtle background */
.dashboard-hero {
  position: relative;
  padding: var(--space-8) var(--space-6);
  margin: calc(-1 * var(--space-8));
  margin-bottom: var(--space-8);
  background: linear-gradient(
    135deg,
    var(--accent-subtle) 0%,
    transparent 60%
  );
  border-radius: var(--radius-2xl);
  overflow: hidden;
}

.dashboard-hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 60%;
  height: 200%;
  background: radial-gradient(
    ellipse at center,
    var(--accent-subtle) 0%,
    transparent 70%
  );
  opacity: 0.5;
  pointer-events: none;
}

.dashboard-hero-content {
  position: relative;
  z-index: 1;
}

.dashboard-greeting {
  font-size: var(--text-3xl);
  font-weight: var(--weight-light);
  letter-spacing: var(--tracking-tight);
  color: var(--fg-default);
  margin: 0 0 var(--space-2) 0;
}

.dashboard-greeting-name {
  font-weight: var(--weight-semibold);
  color: var(--accent);
}

.dashboard-date {
  font-size: var(--text-sm);
  color: var(--fg-muted);
  margin: 0;
}

/* KPI Grid — 3-6 stat cards */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-8);
}

.kpi-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  transition: 
    transform var(--duration-fast) var(--ease-out),
    box-shadow var(--duration-fast) var(--ease-out);
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover);
}

.kpi-label {
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  text-transform: uppercase;
  letter-spacing: var(--tracking-caps);
  color: var(--fg-subtle);
  margin-bottom: var(--space-2);
}

.kpi-value {
  font-size: var(--text-2xl);
  font-weight: var(--weight-semibold);
  color: var(--fg-default);
  line-height: 1;
}

.kpi-value-sm {
  font-size: var(--text-base);
}

.kpi-trend {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  margin-top: var(--space-2);
}

.kpi-trend-up { color: var(--success); }
.kpi-trend-down { color: var(--error); }
.kpi-trend-neutral { color: var(--fg-muted); }

/* Dashboard 2-Column Layout */
.dashboard-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--space-6);
}

.dashboard-primary { /* Main content column */ }
.dashboard-secondary { /* Sidebar column */ }

@media (max-width: 1024px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  
  .dashboard-hero {
    margin: calc(-1 * var(--space-6));
    margin-bottom: var(--space-6);
    padding: var(--space-6) var(--space-4);
  }
}

.page-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.page-actions {
  display: flex;
  gap: var(--space-3);
}

/* Breadcrumbs */
.breadcrumbs {
  font-size: var(--text-sm);
  color: var(--fg-subtle);
  margin-bottom: var(--space-4);
}

.breadcrumbs ol {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  list-style: none;
  padding: 0;
  margin: 0;
}

.breadcrumbs li {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.breadcrumbs svg {
  opacity: 0.5;
}

.breadcrumbs a {
  color: var(--fg-muted);
  transition: color var(--duration-fast) var(--ease-out);
}

.breadcrumbs a:hover {
  color: var(--fg-default);
}

.breadcrumbs svg {
  width: 14px;
  height: 14px;
  opacity: 0.5;
}

.breadcrumbs span[aria-current] {
  color: var(--fg-default);
}

/* Section titles */
.section-title {
  font-size: var(--text-lg);
  font-weight: var(--weight-medium);
  color: var(--fg-default);
  margin-bottom: var(--space-4);
}

/* ============================================================================
   4. BUTTONS — Clean & Simple
   ============================================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: 0.75rem;
  cursor: pointer;
  white-space: nowrap;
  transition: all 150ms ease;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.btn:active:not(:disabled) {
  transform: translateY(0) scale(0.98);
}

.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

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

/* Links as buttons */
a.btn,
a.btn:hover,
a.btn:visited {
  text-decoration: none;
}

/* --- Button Variants --- */

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

.btn-primary:hover:not(:disabled) {
  background: color-mix(in srgb, var(--accent) 85%, black);
  border-color: color-mix(in srgb, var(--accent) 85%, black);
  color: white;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-secondary {
  background: white;
  color: var(--fg-default);
  border-color: var(--border-default);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--bg-subtle);
  border-color: var(--border-emphasis);
}

.btn-ghost {
  background: var(--bg-muted);
  color: var(--fg-default);
  border-color: var(--border-default);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--bg-subtle);
  border-color: var(--border-emphasis);
}

.btn-white {
  background: var(--bg-default);
  color: var(--fg-default);
  border: 1px solid var(--border-default);
}

.btn-white:hover:not(:disabled) {
  background: var(--bg-subtle);
  border-color: var(--border-emphasis);
}

.btn-danger {
  background: var(--error);
  color: white;
  border-color: var(--error);
}

.btn-danger:hover:not(:disabled) {
  background: var(--error-hover, #dc2626);
  border-color: var(--error-hover, #dc2626);
}

.btn-success {
  background: var(--success);
  color: white;
  border-color: var(--success);
}

.btn-warning {
  background: var(--warning);
  color: #1a1a1a;
  border-color: var(--warning);
}

.btn-link {
  background: transparent;
  color: var(--accent);
  border-color: transparent;
  padding: 0.25rem;
}

.btn-link:hover:not(:disabled) {
  text-decoration: underline;
  transform: none;
}

/* --- Button Sizes --- */

.btn-sm {
  padding: 0.5rem 0.875rem;
  font-size: 0.8125rem;
  border-radius: 0.5rem;
}

.btn-lg {
  padding: 0.875rem 1.5rem;
  font-size: 1rem;
  border-radius: 1rem;
}

.btn-icon {
  padding: 0.5rem;
  border-radius: 0.5rem;
}

.btn-icon svg {
  width: 1.25rem;
  height: 1.25rem;
}

/* --- Button Loading State --- */

.btn-loading {
  position: relative;
  pointer-events: none;
}

.btn-loading .btn-text {
  opacity: 0;
}

.btn-loading .btn-spinner {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-spinner svg,
.spinner {
  width: 16px;
  height: 16px;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .btn-spinner svg,
  .spinner {
    animation: none;
  }
}

/* --- Magnetic Hover: Reduced Motion Fallback --- */

@media (prefers-reduced-motion: reduce) {
  .btn,
  .btn-magnetic,
  .btn-primary,
  .btn-secondary,
  .btn-ghost,
  .btn-danger,
  .btn-link {
    /* Disable all motion-based effects */
    transition: 
      opacity var(--duration-fast) ease,
      background-color var(--duration-fast) ease,
      color var(--duration-fast) ease;
    transform: none !important;
    --btn-proximity-strength: 0;
  }
  
  /* Simple opacity/color change only */
  .btn:hover:not(:disabled):not(.btn-magnetic) {
    opacity: 0.85;
    transform: none !important;
  }
  
  /* Magnetic buttons in reduced-motion: disable magnetic, keep hover */
  .btn.btn-magnetic:hover:not(:disabled) {
    transform: none !important;
  }
  
  /* Disable halo animations */
  .btn-primary:hover:not(:disabled),
  .btn-secondary:hover:not(:disabled),
  .btn-ghost:hover:not(:disabled),
  .btn-icon:hover:not(:disabled) {
    box-shadow: none;
  }
  
  /* Instant underline, no animation */
  .btn-link::after {
    transition: none;
  }
}

/* --- Button Success Flash --- */

.btn-success-flash {
  animation: success-flash 0.6s var(--ease-out);
}

@keyframes success-flash {
  0% { box-shadow: var(--shadow-glow); }
  100% { box-shadow: none; }
}

@media (prefers-reduced-motion: reduce) {
  .btn-success-flash {
    animation: none;
  }
}

/* ============================================================================
   SKELETON LOADING
   ============================================================================ */

.skeleton {
  background: linear-gradient(
    90deg,
    var(--bg-subtle) 25%,
    var(--bg-emphasis) 50%,
    var(--bg-subtle) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-md);
}

.skeleton-text {
  height: 1em;
  margin-bottom: var(--space-2);
}

.skeleton-text:last-child {
  margin-bottom: 0;
}

/* Skeleton width variants (for varied loading placeholders) */
.sk-w-40 { width: 40%; }
.sk-w-50 { width: 50%; }
.sk-w-60 { width: 60%; }
.sk-w-70 { width: 70%; }
.sk-w-80 { width: 80%; }
.sk-w-90 { width: 90%; }
.sk-w-full { width: 100%; }

.skeleton-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
}

.skeleton-row {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4);
  border-bottom: 1px solid var(--border-muted);
}

.skeleton-row:last-child {
  border-bottom: none;
}

@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@media (prefers-reduced-motion: reduce) {
  .skeleton {
    animation: none;
    background: var(--bg-subtle);
  }
}

/* ============================================================================
   5. FORMS
   ============================================================================ */

.form-group {
  margin-bottom: var(--space-5);
}

.form-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--fg-default);
  margin-bottom: var(--space-2);
}

.form-label-optional {
  font-weight: var(--weight-normal);
  color: var(--fg-subtle);
}

.input,
.select,
.textarea {
  width: 100%;
  padding: 0.625rem 0.875rem;
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  color: var(--fg-default);
  background: var(--bg-subtle);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  transition:
    border-color var(--duration-fast) var(--ease-out),
    box-shadow var(--duration-fast) var(--ease-out);
}

.input::placeholder,
.textarea::placeholder {
  color: var(--fg-subtle);
}

.input:hover,
.select:hover,
.textarea:hover {
  border-color: var(--border-emphasis);
}

.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-subtle);
}

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

/* ─────────────────────────────────────────────
   Modern Select / Dropdown Styling
   ───────────────────────────────────────────── */

/* Global select reset and styling */
select,
.select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  width: 100%;
  padding: var(--space-2) var(--space-10) var(--space-2) var(--space-3);
  font-family: inherit;
  font-size: var(--text-sm);
  font-weight: var(--weight-normal);
  line-height: var(--leading-normal);
  color: var(--fg-default);
  background-color: var(--bg-surface);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-3) center;
  background-size: 16px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: 
    border-color var(--duration-fast) var(--ease-out),
    box-shadow var(--duration-fast) var(--ease-out),
    background-color var(--duration-fast) var(--ease-out);
}

select:hover,
.select:hover {
  border-color: var(--border-emphasis);
  background-color: var(--bg-muted);
}

select:focus,
.select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-subtle);
  background-color: var(--bg-surface);
}

select:disabled,
.select:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  background-color: var(--bg-muted);
}

/* Select option styling (limited browser support) */
select option {
  padding: var(--space-2) var(--space-3);
  background: var(--bg-surface);
  color: var(--fg-default);
}

/* Dark mode chevron */
[data-theme="dark"] select,
[data-theme="dark"] .select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23a1a1aa' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

/* Small select variant */
select.select-sm,
.select-sm {
  padding: var(--space-1) var(--space-8) var(--space-1) var(--space-2);
  font-size: var(--text-xs);
  border-radius: var(--radius-md);
  background-size: 14px;
  background-position: right var(--space-2) center;
}

/* Large select variant */
select.select-lg,
.select-lg {
  padding: var(--space-3) var(--space-12) var(--space-3) var(--space-4);
  font-size: var(--text-base);
  border-radius: var(--radius-xl);
  background-size: 18px;
  background-position: right var(--space-4) center;
}

/* Error state */
.input-error,
.input-error:hover,
.input-error:focus {
  border-color: var(--error);
}

.input-error:focus {
  box-shadow: 0 0 0 3px var(--error-subtle);
}

.form-error {
  font-size: var(--text-sm);
  color: var(--error);
  margin-top: var(--space-1\.5);
}

.form-hint {
  font-size: var(--text-sm);
  color: var(--fg-subtle);
  margin-top: var(--space-1\.5);
}

/* Checkbox & Radio */
.checkbox-group,
.radio-group {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.checkbox,
.radio {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

/* ============================================================================
   6. CARDS — Floating Premium Style (Prodify-inspired)
   ============================================================================ */

.card {
  position: relative;
  background: var(--bg-surface);
  border: 1px solid transparent;
  border-radius: var(--radius-2xl);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  /* No default hover transition — only .card--hoverable has lift */
}

/* "Paper lift" effect — only for hoverable cards (dashboard summaries) */
.card--hoverable {
  transition:
    transform 200ms ease-out,
    box-shadow 200ms ease-out;
}

.card--hoverable:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-card-hover);
  z-index: 10;
}

.card-header {
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--border-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  background: transparent;
}

.card-title {
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  color: var(--fg-default);
  margin: 0;
}

.card-body {
  padding: var(--space-5) var(--space-6);
}

.card-footer {
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--border-muted);
  background: var(--bg-muted);
}

/* Card variants */
.card-flat {
  box-shadow: none;
}

.card-flat:hover {
  transform: none;
  box-shadow: none;
}

/* ============================================================================
   7. TABLES — Modern Minimal Style
   ============================================================================ */

.table-container {
  background: var(--bg-surface);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius-2xl);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.table th,
.table td {
  padding: var(--space-4) var(--space-5);
  text-align: left;
}

.table th {
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  text-transform: uppercase;
  letter-spacing: var(--tracking-caps);
  color: var(--fg-subtle);
  background: transparent;
  border-bottom: 1px solid var(--border-muted);
}

.table td {
  color: var(--fg-default);
  border-bottom: 1px solid var(--border-muted);
}

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

/* Subtle row hover — very soft purple tint */
.table tbody tr {
  position: relative;
  transition: background var(--duration-fast) var(--ease-out);
}

.table tbody tr:hover {
  background: var(--row-hover-bg);
}

.table-actions {
  display: flex;
  gap: var(--space-2);
  justify-content: flex-end;
}

/* ============================================================================
   8. BADGES & STATUS
   ============================================================================ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-2);
  height: var(--space-6);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-caps);
  border-radius: var(--radius-full);
  background: var(--bg-subtle);
  color: var(--fg-muted);
  white-space: nowrap;
}

/* Badge sizes */
.badge-sm {
  padding: var(--space-0\.5) var(--space-1\.5);
  height: var(--space-5);
  font-size: 10px;
}

.badge-lg {
  padding: var(--space-1\.5) var(--space-3);
  height: var(--space-7);
  font-size: var(--text-sm);
}

.badge-success {
  background: var(--success-subtle);
  color: var(--success);
}

.badge-warning {
  background: var(--warning-subtle);
  color: var(--warning-fg);
}

.badge-error {
  background: var(--error-subtle);
  color: var(--error);
}

.badge-info {
  background: var(--info-subtle);
  color: var(--info);
}

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

/* Status dot */
.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  background: currentColor;
}

/* --- Legacy Badge Aliases (Compatibility Layer) --- */
.badge-ok { 
  background: var(--success-subtle);
  color: var(--success);
}
.badge-warn {
  background: var(--warning-subtle);
  color: var(--warning-fg);
}
.badge-muted {
  background: var(--bg-subtle);
  color: var(--fg-muted);
}

/* Accent Badge Colors (Prodify-style) */
.badge-cyan {
  background: var(--badge-cyan-bg);
  color: var(--badge-cyan);
}

.badge-pink {
  background: var(--badge-pink-bg);
  color: var(--badge-pink);
}

.badge-orange {
  background: var(--badge-orange-bg);
  color: var(--badge-orange);
}

.badge-purple {
  background: var(--badge-purple-bg);
  color: var(--badge-purple);
}

/* ============================================================================
   9. ALERTS & FEEDBACK
   ============================================================================ */

.alert {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4);
  border-radius: var(--radius-xl);
  font-size: var(--text-sm);
  margin-bottom: var(--space-6);
}

.alert-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}

.alert-content {
  flex: 1;
}

.alert-title {
  font-weight: var(--weight-medium);
  margin-bottom: var(--space-1);
}

.alert-success {
  background: hsl(152 69% 40%);
  border-color: hsl(152 69% 35%);
  color: white;
}

.alert-warning {
  background: hsl(38 92% 50%);
  border-color: hsl(38 92% 45%);
  color: white;
}

.alert-error {
  background: hsl(0 72% 51%);
  border-color: hsl(0 72% 45%);
  color: white;
}

.alert-info {
  background: var(--info-subtle);
  color: var(--info);
}

/* Alert with extra bottom spacing */
.alert--spaced {
  margin-bottom: var(--space-6);
}

/* Flash messages */
.flash-messages {
  margin-bottom: var(--space-6);
}

.flash {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-xl);
  font-size: var(--text-sm);
  margin-bottom: var(--space-3);
}

.flash:last-child {
  margin-bottom: 0;
}

.flash-success {
  background: var(--success-subtle);
  color: var(--success);
}

.flash-error {
  background: var(--error-subtle);
  color: var(--error);
}

/* ============================================================================
   10. MODALS & OVERLAYS
   ============================================================================ */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  z-index: var(--z-overlay);
  -webkit-backdrop-filter: blur(var(--glass-blur-sm));
  backdrop-filter: blur(var(--glass-blur-sm));
  opacity: 0;
  transition: opacity var(--duration-normal) var(--ease-out);
}

.modal-backdrop.active {
  opacity: 1;
}

.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.96);
  z-index: var(--z-modal);
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  background: var(--bg-surface);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-3xl);
  box-shadow: var(--shadow-float-lg);
  opacity: 0;
  transition:
    opacity var(--duration-normal) var(--ease-out),
    transform var(--duration-normal) var(--ease-spring);
  
  /* Subtle glass effect for tooltips */
  -webkit-backdrop-filter: blur(var(--glass-blur-sm));
  backdrop-filter: blur(var(--glass-blur-sm));
}

.modal.active {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.modal-header {
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--border-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: var(--text-lg);
  font-weight: var(--weight-medium);
}

.modal-close {
  padding: var(--space-2);
  background: none;
  border: none;
  color: var(--fg-subtle);
  cursor: pointer;
  border-radius: var(--radius-lg);
  transition: background var(--duration-fast) var(--ease-out);
}

.modal-close:hover {
  background: var(--bg-subtle);
  color: var(--fg-default);
}

.modal-body {
  padding: var(--space-6);
  overflow-y: auto;
}

.modal-footer {
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--border-muted);
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
}

/* Dropdown — Floating Glass */
.dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  min-width: 200px;
  margin-top: var(--space-2);
  padding: var(--space-1);
  background: var(--bg-surface);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-float);
  z-index: var(--z-dropdown);
  
  /* Real glass effect on dropdowns */
  background: var(--glass-bg-float);
  -webkit-backdrop-filter: blur(var(--glass-blur-md)) saturate(var(--glass-saturate-sm));
  backdrop-filter: blur(var(--glass-blur-md)) saturate(var(--glass-saturate-sm));
  
  /* Initial state */
  opacity: 0;
  transform: translateY(var(--motion-popover-offset)) scale(0.98);
  transform-origin: top right;
  pointer-events: none;
  transition:
    opacity var(--duration-fast) var(--ease-out),
    transform var(--duration-fast) var(--ease-spring);
}

.dropdown.open .dropdown-menu {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2\.5) var(--space-3);
  font-size: var(--text-sm);
  color: var(--fg-muted);
  cursor: pointer;
  border-radius: var(--radius-lg);
  transition: 
    background var(--duration-fast) var(--ease-out),
    color var(--duration-fast) var(--ease-out);
}

.dropdown-item:hover {
  background: var(--accent-muted);
  color: var(--fg-default);
}

.dropdown-item:first-child {
  border-radius: var(--radius-lg);
}

.dropdown-item:last-child {
  border-radius: var(--radius-lg);
}

/* Dropdown divider */
.dropdown-divider {
  height: 1px;
  background: var(--border-muted);
  margin: var(--space-1) 0;
}

/* ============================================================================
   11. UTILITIES
   ============================================================================ */

/* Display */
.hidden { display: none !important; }
.block { display: block; }
.inline { display: inline; }
.inline-block { display: inline-block; }
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.grid { 
  display: grid;
  align-items: start; /* Allow children to lift on hover */
}

/* Flex utilities */
.flex-1 { flex: 1; }
.flex-auto { flex: auto; }
.flex-none { flex: none; }
.flex-col { flex-direction: column; }
.flex-row { flex-direction: row; }
.flex-wrap { flex-wrap: wrap; }
.items-start { align-items: flex-start; }
.items-center { align-items: center; }
.items-end { align-items: flex-end; }
.justify-start { justify-content: flex-start; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.justify-between { justify-content: space-between; }

/* Gap */
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-5 { gap: var(--space-5); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

/* Grid layouts */
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

/* Text */
.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--fg-muted); }
.text-subtle { color: var(--fg-subtle); }
.text-accent { color: var(--accent); }
.text-success { color: var(--success); }
.text-error { color: var(--error); }
.text-warning { color: var(--warning); }

/* Font */
.font-light { font-weight: var(--weight-light); }
.font-normal { font-weight: var(--weight-normal); }
.font-medium { font-weight: var(--weight-medium); }
.font-semibold { font-weight: var(--weight-semibold); }
.font-mono { font-family: var(--font-mono); }
.text-xs { font-size: var(--text-xs); }
.text-sm { font-size: var(--text-sm); }
.text-base { font-size: var(--text-base); }
.text-lg { font-size: var(--text-lg); }
.text-xl { font-size: var(--text-xl); }
.tracking-wide { letter-spacing: 0.25em; }
.tracking-caps { letter-spacing: var(--tracking-caps); }
.whitespace-nowrap { white-space: nowrap; }
.uppercase { text-transform: uppercase; letter-spacing: var(--tracking-caps); }
.capitalize { text-transform: capitalize; }

/* Spacing */
.m-0 { margin: 0; }
.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mb-1 { margin-bottom: var(--space-1); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.ml-auto { margin-left: auto; }
.mr-auto { margin-right: auto; }
.mx-auto { margin-left: auto; margin-right: auto; }

.p-0 { padding: 0; }
.p-2 { padding: var(--space-2); }
.p-3 { padding: var(--space-3); }
.p-4 { padding: var(--space-4); }
.p-6 { padding: var(--space-6); }
.px-2 { padding-left: var(--space-2); padding-right: var(--space-2); }
.px-3 { padding-left: var(--space-3); padding-right: var(--space-3); }
.px-4 { padding-left: var(--space-4); padding-right: var(--space-4); }
.py-2 { padding-top: var(--space-2); padding-bottom: var(--space-2); }
.py-3 { padding-top: var(--space-3); padding-bottom: var(--space-3); }
.py-4 { padding-top: var(--space-4); padding-bottom: var(--space-4); }

/* Width */
.w-full { width: 100%; }
.w-auto { width: auto; }
.min-w-150 { min-width: 150px; }
.min-w-200 { min-width: 200px; }
.max-w-xs { max-width: 450px; }
.max-w-sm { max-width: 500px; }
.max-w-md { max-width: 600px; }
.max-w-lg { max-width: 800px; }
.max-w-xl { max-width: 900px; }
.max-w-2xl { max-width: 1000px; }

/* Border radius */
.rounded { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-2xl { border-radius: var(--radius-2xl); }
.rounded-full { border-radius: var(--radius-full); }

/* Stack (vertical spacing) */
.stack > * + * {
  margin-top: var(--space-4);
}

.stack-sm > * + * {
  margin-top: var(--space-2);
}

.stack-lg > * + * {
  margin-top: var(--space-6);
}

/* Cluster (horizontal spacing) */
.cluster {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

/* Divider */
.divider {
  height: 1px;
  background: var(--border-default);
  margin: var(--space-6) 0;
}

/* Visually hidden (accessible) */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Border utilities */
.border-b { border-bottom: 1px solid var(--border-default); }
.border-t { border-top: 1px solid var(--border-default); }
.border-dashed { border-style: dashed; }
.border-muted { border-color: var(--border-muted); }
.border-error { border-color: var(--error); }

/* Cursor utilities */
.cursor-pointer { cursor: pointer; }
.cursor-not-allowed { cursor: not-allowed; }

/* Inline form (no margins) */
.inline-form { margin: 0; display: inline; }

/* Step badge (numbered circles) */
.step-badge {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: var(--weight-semibold);
  font-size: var(--text-sm);
  background: var(--success-subtle);
  color: var(--success);
}

/* Checkbox/radio label */
.checkbox-label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
}
.checkbox-label:has(input:disabled) {
  cursor: not-allowed;
  opacity: 0.6;
}

/* Checkbox card (selectable option) */
.checkbox-card {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--bg-muted);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  cursor: pointer;
}
.checkbox-card:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-subtle);
}

/* Highlight box (subtle background) */
.highlight-box {
  background: var(--bg-muted);
  border-radius: var(--radius-lg);
}

/* Permission card (grouped checkboxes) */
.permission-card {
  padding: var(--space-4);
  background: var(--bg-muted);
  border-radius: var(--radius-lg);
}
.permission-card-title {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  margin-bottom: var(--space-3);
  text-transform: capitalize;
}
.permission-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: var(--space-2);
}
.permission-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  padding: var(--space-2);
  border-radius: var(--radius-sm);
}
.permission-item-name {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  display: block;
}
.permission-item-key {
  font-size: var(--text-xs);
  color: var(--fg-muted);
  font-family: var(--font-mono);
}

/* Danger card/zone */
.card-danger {
  border-color: var(--error);
}
.card-danger .card-title,
.text-danger {
  color: var(--error);
}

/* Recovery code grid */
.recovery-code-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}
.recovery-code {
  font-family: var(--font-mono);
  font-size: var(--text-base);
  padding: var(--space-3);
  background: var(--bg-muted);
  border-radius: var(--radius-lg);
  text-align: center;
  letter-spacing: 1px;
}

/* OTP input */
.otp-input {
  font-family: var(--font-mono);
  letter-spacing: 0.25em;
  text-align: center;
}

/* QR code container */
.qr-container {
  display: flex;
  justify-content: center;
  padding: var(--space-4);
  background: white;
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-4);
}

/* Inline code snippet */
.code-inline {
  font-size: var(--text-xs);
  font-family: var(--font-mono);
  background: var(--bg-muted);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  color: var(--fg-muted);
}

/* Filter form grid */
.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-4);
  align-items: end;
}

/* Audit/log entry styles */
.audit-actor {
  font-weight: var(--weight-medium);
  font-size: var(--text-sm);
}
.audit-meta {
  font-size: var(--text-xs);
  color: var(--fg-muted);
}
.audit-timestamp {
  font-size: var(--text-xs);
  color: var(--fg-muted);
  white-space: nowrap;
}
.audit-entity {
  font-size: var(--text-sm);
}
.audit-entity-type {
  font-size: var(--text-xs);
  color: var(--fg-muted);
}

/* Session/device info */
.session-device {
  font-weight: var(--weight-medium);
}
.session-info {
  font-size: var(--text-sm);
  font-family: var(--font-mono);
}

/* Role key badge */
.role-key {
  font-size: var(--text-xs);
  font-family: var(--font-mono);
  background: var(--bg-muted);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  color: var(--fg-muted);
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.pagination-info {
  font-size: var(--text-sm);
  color: var(--fg-muted);
}

/* Password strength indicator */
.password-strength {
  height: 4px;
  background: var(--border-default);
  border-radius: var(--radius-sm);
  margin-top: var(--space-2);
  overflow: hidden;
}
.password-strength-bar {
  height: 100%;
  width: 0%;
  transition: all 0.2s ease;
  border-radius: var(--radius-sm);
}

/* Border left utilities for status */
.border-l-success { border-left: 4px solid var(--success); }
.border-l-warning { border-left: 4px solid var(--warning); }
.border-l-error { border-left: 4px solid var(--error); }
.border-l-info { border-left: 4px solid var(--info); }

/* 2xl text size */
.text-2xl { font-size: var(--text-xl); line-height: 1.3; }

/* Width utilities (for skeletons, etc.) */
.w-full { width: 100%; }
.w-80 { width: 80%; }
.w-60 { width: 60%; }
.w-40 { width: 40%; }
.w-20 { width: 20%; }

/* Min-width utilities */
.min-w-150 { min-width: 150px; }
.min-w-200 { min-width: 200px; }

/* Height utilities (for spacers) */
.h-48 { height: 12rem; } /* 192px */
.h-64 { height: 16rem; } /* 256px */
.h-96 { height: 24rem; } /* 384px */

/* Centering utilities */
.items-center { align-items: center; }
.justify-center { justify-content: center; }

/* pt utilities */
.pt-4 { padding-top: var(--space-4); }
.pt-6 { padding-top: var(--space-6); }

/* ============================================================================
   SEARCH INPUT
   ============================================================================ */

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-input-wrapper svg {
  position: absolute;
  left: var(--space-3);
  width: 16px;
  height: 16px;
  color: var(--fg-subtle);
  pointer-events: none;
}

.search-input {
  padding-left: var(--space-9);
  background: var(--bg-muted);
  border-color: transparent;
}

.search-input:focus {
  background: var(--bg-surface);
  border-color: var(--accent);
}

/* ============================================================================
   USER AVATAR
   ============================================================================ */

.avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--accent);
  color: var(--fg-on-accent);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
}

.avatar-sm {
  width: 28px;
  height: 28px;
  font-size: var(--text-xs);
}

.avatar-lg {
  width: 48px;
  height: 48px;
  font-size: var(--text-lg);
}

/* ============================================================================
   THEME TOGGLE ICONS
   ============================================================================ */

.icon-sun,
.icon-moon {
  width: 18px;
  height: 18px;
}

/* Show/hide based on theme (controlled by JS) */
:root[data-theme="light"] .icon-sun,
:root[data-theme="dark"] .icon-moon {
  display: none;
}

:root[data-theme="light"] .icon-moon,
:root[data-theme="dark"] .icon-sun {
  display: block;
}

/* ============================================================================
   INFO GRID (Dashboard stats)
   ============================================================================ */

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--space-4);
}

.info-item {
  padding: var(--space-4);
  background: var(--bg-muted);
  border-radius: var(--radius-xl);
}

.info-label {
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  text-transform: uppercase;
  letter-spacing: var(--tracking-caps);
  color: var(--fg-subtle);
  margin-bottom: var(--space-1);
}

.info-value {
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  color: var(--fg-default);
}

/* ============================================================================
   EMPTY STATE
   ============================================================================ */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-12) var(--space-6);
  text-align: center;
}

.empty-state svg {
  width: 64px;
  height: 64px;
  color: var(--fg-subtle);
  opacity: 0.5;
  margin-bottom: var(--space-4);
}

.empty-state h3 {
  font-size: var(--text-lg);
  font-weight: var(--weight-medium);
  color: var(--fg-default);
  margin-bottom: var(--space-2);
}

.empty-state p {
  color: var(--fg-muted);
  max-width: 40ch;
}

/* --- Legacy Empty State Aliases (Compatibility Layer) --- */
.empty-state-icon {
  font-size: 3rem;
  opacity: 0.5;
  margin-bottom: var(--space-4);
}

.empty-state-title {
  font-size: var(--text-lg);
  font-weight: var(--weight-medium);
  color: var(--fg-default);
  margin-bottom: var(--space-2);
}

.empty-state-description {
  color: var(--fg-muted);
  max-width: 40ch;
  margin-bottom: var(--space-4);
}

/* ============================================================================
   RESPONSIVE
   ============================================================================ */

@media (max-width: 1024px) {
  .app-sidebar {
    width: var(--sidebar-collapsed);
  }
  
  .app-main {
    margin-left: var(--sidebar-collapsed);
  }
  
  .sidebar-logo-text,
  .nav-item span,
  .nav-label {
    display: none;
  }
  
  .nav-item {
    justify-content: center;
    padding: var(--space-3);
  }
}

@media (max-width: 768px) {
  /* Sidebar drawer mode — full sidebar, not icon-only */
  .app-sidebar {
    transform: translateX(-100%);
    width: var(--sidebar-width);
    transition: transform var(--duration-normal) var(--ease-out);
  }
  
  .app-sidebar.is-open {
    transform: translateX(0);
  }
  
  /* Reset collapsed mode overrides — show full sidebar content */
  .app-sidebar .sidebar-logo-text,
  .app-sidebar .nav-item span,
  .app-sidebar .nav-label {
    display: block;
  }
  
  .app-sidebar .nav-item {
    justify-content: flex-start;
    padding: var(--space-2) var(--space-3);
    gap: var(--space-3);
  }
  
  .app-sidebar .nav-item svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
  }
  
  /* Backdrop overlay when sidebar is open */
  .sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: var(--overlay-backdrop);
    z-index: calc(var(--z-sidebar) - 1);
    opacity: 0;
    transition: opacity var(--duration-normal) var(--ease-out);
  }
  
  .sidebar-backdrop.is-visible {
    display: block;
    opacity: 1;
  }
  
  /* Show menu toggle button */
  .sidebar-toggle {
    display: flex;
  }
  
  .app-main {
    margin-left: 0;
  }
  
  .app-content {
    padding: var(--space-4);
  }
  
  .topbar {
    padding: 0 var(--space-4);
  }
  
  .grid-cols-2,
  .grid-cols-3,
  .grid-cols-4 {
    grid-template-columns: 1fr;
  }
  
  .page-header-row {
    flex-direction: column;
    align-items: stretch;
  }
  
  .page-actions {
    justify-content: flex-start;
  }
  
  .modal {
    width: 95%;
    max-height: 95vh;
  }
}

/* Sidebar toggle button (hidden on desktop) */
.sidebar-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: var(--radius-lg);
  color: var(--fg-default);
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-out);
}

.sidebar-toggle:hover {
  background: var(--bg-subtle);
}

.sidebar-toggle:focus-visible {
  box-shadow: var(--focus-ring);
}

@media (prefers-reduced-motion: reduce) {
  .app-sidebar,
  .sidebar-backdrop {
    transition: none;
  }
}

/* ============================================================================
   ORGANIC MOTION SYSTEM — Page Transitions & Content Reveal
   ============================================================================ */

/* --- Page Transition States --- */

/* Leaving state (before navigation) */
.is-leaving .app-content {
  opacity: 0;
  transition: opacity var(--motion-duration-2) var(--motion-ease-standard);
}

/* Loaded state (on page load) */
.app-content {
  opacity: 1;
  transition: opacity var(--motion-duration-3) var(--motion-ease-standard);
}

/* --- View Transitions API (Progressive Enhancement) --- */

@supports (view-transition-name: none) {
  ::view-transition-old(root) {
    animation: vt-fade-out var(--motion-duration-3) var(--motion-ease-standard) forwards;
  }
  
  ::view-transition-new(root) {
    animation: vt-fade-in var(--motion-duration-3) var(--motion-ease-standard) forwards;
  }
  
  @keyframes vt-fade-out {
    to { opacity: 0; }
  }
  
  @keyframes vt-fade-in {
    from { opacity: 0; }
  }
}

/* --- Content Reveal Animation --- */

@keyframes reveal-in {
  from {
    opacity: var(--motion-opacity-start);
    transform: translateY(var(--motion-distance-1));
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes reveal-in-medium {
  from {
    opacity: var(--motion-opacity-start);
    transform: translateY(var(--motion-distance-2));
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Base reveal utility */
.reveal {
  animation: reveal-in var(--motion-duration-2) var(--motion-ease-emphasized) both;
}

.reveal-medium {
  animation: reveal-in-medium var(--motion-duration-2) var(--motion-ease-emphasized) both;
}

/* Instant (opt-out) */
.reveal-instant,
.reveal-none {
  animation: none;
  opacity: 1;
  transform: none;
}

/* Manual delay tiers */
.reveal-delay-1 { animation-delay: calc(1 * var(--motion-stagger-step)); }
.reveal-delay-2 { animation-delay: calc(2 * var(--motion-stagger-step)); }
.reveal-delay-3 { animation-delay: calc(3 * var(--motion-stagger-step)); }
.reveal-delay-4 { animation-delay: calc(4 * var(--motion-stagger-step)); }

/* --- Staggered Children (max 8) --- */

.reveal-stagger > * {
  opacity: var(--motion-opacity-start);
  animation: reveal-in var(--motion-duration-2) var(--motion-ease-emphasized) both;
}

.reveal-stagger > *:nth-child(1) { animation-delay: calc(0 * var(--motion-stagger-step)); }
.reveal-stagger > *:nth-child(2) { animation-delay: calc(1 * var(--motion-stagger-step)); }
.reveal-stagger > *:nth-child(3) { animation-delay: calc(2 * var(--motion-stagger-step)); }
.reveal-stagger > *:nth-child(4) { animation-delay: calc(3 * var(--motion-stagger-step)); }
.reveal-stagger > *:nth-child(5) { animation-delay: calc(4 * var(--motion-stagger-step)); }
.reveal-stagger > *:nth-child(6) { animation-delay: calc(5 * var(--motion-stagger-step)); }
.reveal-stagger > *:nth-child(7) { animation-delay: calc(6 * var(--motion-stagger-step)); }
.reveal-stagger > *:nth-child(8) { animation-delay: calc(7 * var(--motion-stagger-step)); }

/* No stagger after 8th item */
.reveal-stagger > *:nth-child(n+9) {
  animation-delay: calc(7 * var(--motion-stagger-step));
}

/* --- Auto-Reveal Common Elements --- */

/* Page header animation handled in liquid-glass.css */

/* Card reveal - set base state, animate from different values */
.card {
  opacity: 1; /* Ensure cards stay visible */
}

.card:not(.reveal-none) {
  animation: card-reveal var(--motion-duration-2) var(--motion-ease-emphasized);
}

@keyframes card-reveal {
  0% {
    opacity: 0;
    transform: translateY(12px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Card grids with stagger */
.card-grid > .card:nth-child(1) { animation-delay: calc(0 * var(--motion-stagger-step)); }
.card-grid > .card:nth-child(2) { animation-delay: calc(1 * var(--motion-stagger-step)); }
.card-grid > .card:nth-child(3) { animation-delay: calc(2 * var(--motion-stagger-step)); }
.card-grid > .card:nth-child(4) { animation-delay: calc(3 * var(--motion-stagger-step)); }
.card-grid > .card:nth-child(5) { animation-delay: calc(4 * var(--motion-stagger-step)); }
.card-grid > .card:nth-child(6) { animation-delay: calc(5 * var(--motion-stagger-step)); }

.empty-state {
  animation: reveal-in-medium var(--motion-duration-3) var(--motion-ease-emphasized) both;
  animation-delay: var(--motion-duration-1);
}

/* --- Modal Animation (Enhanced) --- */

.modal {
  animation: modal-enter var(--motion-duration-2) var(--motion-ease-emphasized) both;
}

@keyframes modal-enter {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

/* --- Dropdown/Popover Micro-Transitions --- */

@keyframes popover-enter {
  from {
    opacity: 0;
    transform: translateY(var(--motion-popover-offset)) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.dropdown.open .dropdown-menu {
  animation: popover-enter var(--motion-duration-1) var(--motion-ease-emphasized) both;
}

/* --- Hover Intent Glow (Organic Approach) --- */

/* Buttons: No glow, only background/color change on hover */

/* Nav items with intent highlight */
/* Nav item hover glow removed — only background animation */

/* --- Toast/Flash Animation --- */

.alert {
  animation: slide-in-down var(--motion-duration-2) var(--motion-ease-emphasized) both;
}

@keyframes slide-in-down {
  from {
    opacity: 0;
    transform: translateY(calc(-1 * var(--motion-distance-1)));
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- Dense Context Adaptation --- */

/* Admin tables: container only, faster */
.table-container {
  animation: reveal-in var(--motion-duration-1) var(--motion-ease-standard) both;
}

/* Disable row animations in tables */
.table tbody tr {
  animation: none;
}

/* --- Reduced Motion: CRITICAL --- */

@media (prefers-reduced-motion: reduce) {
  /* Disable all reveal animations */
  .reveal,
  .reveal-medium,
  .reveal-stagger > *,
  .page-header,
  .card,
  .empty-state,
  .modal,
  .alert,
  .table-container,
  .dropdown-menu {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
  
  /* Disable page transitions */
  .is-leaving .app-content,
  .app-content {
    transition: none !important;
    opacity: 1 !important;
  }
  
  /* Disable view transitions */
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation: none !important;
  }
  
  /* Keep essential micro-state changes minimal */
  .btn,
  .nav-item,
  .input,
  .select,
  .dropdown-item,
  .table tbody tr {
    transition-duration: 0.01ms !important;
  }
  
  /* Hover glow effects already removed from nav-items */
  
  /* Instant dropdown appearance */
  .dropdown.open .dropdown-menu {
    transform: translateY(0) scale(1) !important;
  }
}

/* ============================================================================
   WELCOME PAGE — Landing page styles (token-first)
   ============================================================================ */

/* Layout */
.welcome-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-5);
}

.welcome-wrapper {
  max-width: 640px;
  width: 100%;
}

.welcome-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  padding: var(--space-12);
  box-shadow: var(--shadow-xl);
}

/* Header */
.welcome-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-8);
  flex-wrap: wrap;
  gap: var(--space-4);
}

.welcome-logo {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.welcome-logo-icon {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, var(--accent), var(--accent-gradient-end));
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
}

.welcome-logo-text {
  font-size: var(--text-3xl);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-tight);
  color: var(--fg-default);
}

.welcome-header-controls {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.welcome-version-badge {
  font-size: var(--text-sm);
  color: var(--fg-subtle);
  background: var(--bg-muted);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
}

/* Locale Switcher */
.welcome-locale-switcher {
  display: flex;
  background: var(--bg-muted);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.welcome-locale-btn {
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  text-decoration: none;
  color: var(--fg-subtle);
  transition: all var(--duration-fast);
  border: none;
  background: transparent;
  cursor: pointer;
}

.welcome-locale-btn:hover {
  color: var(--fg-default);
}

.welcome-locale-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.welcome-locale-btn.active {
  background: var(--accent);
  color: var(--fg-on-accent);
}

/* Status Banner */
.welcome-status-banner {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--success-subtle);
  border: 1px solid var(--success);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-8);
}

.welcome-status-dot {
  width: 10px;
  height: 10px;
  background: var(--success);
  border-radius: var(--radius-full);
  animation: welcome-pulse 2s infinite;
}

@keyframes welcome-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@media (prefers-reduced-motion: reduce) {
  .welcome-status-dot {
    animation: none;
  }
}

.welcome-status-text {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--success-fg);
}

/* Content */
.welcome-title {
  font-size: var(--text-2xl);
  font-weight: var(--weight-semibold);
  color: var(--fg-default);
  margin-bottom: var(--space-3);
}

.welcome-subtitle {
  color: var(--fg-muted);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-6);
}

/* Checklist */
.welcome-checklist {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--space-8) 0;
}

.welcome-checklist-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border-default);
  color: var(--fg-muted);
  font-size: var(--text-base);
}

.welcome-checklist-item:last-child {
  border-bottom: none;
}

.welcome-check-icon {
  width: 20px;
  height: 20px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xs);
  flex-shrink: 0;
}

.welcome-check-icon.done {
  background: var(--success);
  color: var(--fg-on-accent);
}

.welcome-check-icon.pending {
  background: var(--bg-muted);
  color: var(--fg-subtle);
}

/* Actions */
.welcome-actions {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}

/* Footer */
.welcome-footer {
  margin-top: var(--space-8);
  text-align: center;
  color: var(--fg-subtle);
  font-size: var(--text-sm);
}

/* Debug info */
.welcome-debug-info {
  margin-top: var(--space-6);
  padding: var(--space-4);
  background: var(--bg-muted);
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--fg-subtle);
}

.welcome-debug-info code {
  color: var(--accent);
}

/* ============================================================================
   13. INSTALL GUARD — Not Installed Screen (P14)
   ============================================================================ */

.install-guard-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-5);
  background: var(--canvas-bg);
}

.install-guard-wrapper {
  max-width: 560px;
  width: 100%;
}

.install-guard-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  padding: var(--space-10);
  box-shadow: var(--shadow-xl);
}

.install-guard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-6);
}

.install-guard-logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.install-guard-logo-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--accent), var(--accent-gradient-end));
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-2xl);
}

.install-guard-logo-text {
  font-size: var(--text-2xl);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-tight);
  color: var(--fg-default);
}

.install-guard-alert {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--warning-subtle);
  border: 1px solid var(--warning);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-6);
}

.install-guard-alert-icon {
  font-size: var(--text-lg);
}

.install-guard-alert-text {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--warning);
}

.install-guard-title {
  font-size: var(--text-xl);
  font-weight: var(--weight-semibold);
  color: var(--fg-default);
  margin-bottom: var(--space-3);
}

.install-guard-subtitle {
  color: var(--fg-muted);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-6);
}

.install-guard-steps {
  background: var(--bg-muted);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  margin-bottom: var(--space-6);
}

.install-guard-steps-title {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--fg-default);
  margin-bottom: var(--space-3);
  text-transform: uppercase;
  letter-spacing: var(--tracking-caps);
}

.install-guard-steps-list {
  list-style: decimal;
  padding-left: var(--space-5);
  margin: 0;
  color: var(--fg-muted);
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
}

.install-guard-steps-list li {
  margin-bottom: var(--space-2);
}

.install-guard-steps-list li:last-child {
  margin-bottom: 0;
}

.install-guard-steps-list code {
  background: var(--bg-surface);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--accent);
}

.install-guard-actions {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.install-guard-footer {
  margin-top: var(--space-6);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border-muted);
  text-align: center;
  color: var(--fg-subtle);
  font-size: var(--text-sm);
}

.install-guard-footer code {
  background: var(--bg-muted);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--accent);
}

/* ============================================================================
   14. INSTALL GUIDE — Static HTML Installation Page (P14.1)
   ============================================================================ */

.install-guide-container {
  min-height: 100vh;
  padding: var(--space-6);
  background: var(--canvas-bg);
}

.install-guide-wrapper {
  max-width: 800px;
  margin: 0 auto;
}

.install-guide-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  box-shadow: var(--shadow-xl);
}

.install-guide-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border-muted);
}

.install-guide-logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.install-guide-logo-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--accent), var(--accent-gradient-end));
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-2xl);
}

.install-guide-logo-text {
  font-size: var(--text-2xl);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-tight);
  color: var(--fg-default);
}

.install-guide-title {
  font-size: var(--text-3xl);
  font-weight: var(--weight-semibold);
  color: var(--fg-default);
  margin-bottom: var(--space-3);
}

.install-guide-subtitle {
  color: var(--fg-muted);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-6);
  font-size: var(--text-lg);
}

.install-guide-section {
  margin-bottom: var(--space-8);
}

.install-guide-section-title {
  font-size: var(--text-xl);
  font-weight: var(--weight-semibold);
  color: var(--fg-default);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-2);
  border-bottom: 2px solid var(--accent);
}

.install-guide-text {
  color: var(--fg-muted);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-4);
}

.install-guide-note {
  color: var(--fg-muted);
  font-size: var(--text-sm);
  margin-top: var(--space-3);
}

.install-guide-note code {
  background: var(--bg-muted);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--accent);
}

.install-guide-table-wrapper {
  overflow-x: auto;
  margin-bottom: var(--space-4);
}

.install-guide-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.install-guide-table th,
.install-guide-table td {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  border-bottom: 1px solid var(--border-muted);
}

.install-guide-table th {
  font-weight: var(--weight-semibold);
  color: var(--fg-default);
  background: var(--bg-muted);
}

.install-guide-table td {
  color: var(--fg-muted);
}

.install-guide-steps {
  background: var(--bg-muted);
  border-radius: var(--radius-md);
  padding: var(--space-5);
}

.install-guide-steps-list {
  list-style: decimal;
  padding-left: var(--space-5);
  margin: 0;
  color: var(--fg-default);
}

.install-guide-steps-list li {
  margin-bottom: var(--space-4);
  line-height: var(--leading-relaxed);
}

.install-guide-steps-list li:last-child {
  margin-bottom: 0;
}

.install-guide-steps-list strong {
  display: block;
  margin-bottom: var(--space-2);
  color: var(--fg-default);
}

.install-guide-code {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  margin-top: var(--space-2);
  overflow-x: auto;
}

.install-guide-code code {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--accent);
  white-space: pre;
  display: block;
}

.install-guide-checklist {
  list-style: none;
  padding: 0;
  margin: 0;
}

.install-guide-checklist li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border-muted);
  color: var(--fg-muted);
  font-size: var(--text-sm);
}

.install-guide-checklist li:last-child {
  border-bottom: none;
}

.install-guide-checklist li::before {
  content: "☐";
  flex-shrink: 0;
  color: var(--fg-subtle);
}

.install-guide-checklist code {
  background: var(--bg-muted);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--accent);
}

.install-guide-faq {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.install-guide-faq-item {
  background: var(--bg-muted);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.install-guide-faq-item summary {
  padding: var(--space-4);
  font-weight: var(--weight-medium);
  color: var(--fg-default);
  cursor: pointer;
  list-style: none;
}

.install-guide-faq-item summary::-webkit-details-marker {
  display: none;
}

.install-guide-faq-item summary::before {
  content: "▶";
  display: inline-block;
  margin-right: var(--space-2);
  font-size: var(--text-xs);
  transition: transform var(--duration-fast);
}

.install-guide-faq-item[open] summary::before {
  transform: rotate(90deg);
}

.install-guide-faq-item p {
  padding: 0 var(--space-4) var(--space-4);
  color: var(--fg-muted);
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
  margin: 0;
}

.install-guide-faq-item code {
  background: var(--bg-surface);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--accent);
}

.install-guide-footer {
  margin-top: var(--space-8);
  padding-top: var(--space-6);
  border-top: 1px solid var(--border-muted);
  text-align: center;
}

.install-guide-footer p {
  color: var(--fg-subtle);
  font-size: var(--text-sm);
  margin-bottom: var(--space-4);
}

.install-guide-footer code {
  background: var(--bg-muted);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--accent);
}

/* ============================================================================
   12. AUTH PAGES — Login, Register, Forgot Password
   ============================================================================ */

.auth-layout {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--canvas-bg);
  position: relative;
  padding: var(--space-6);
}

/* Canvas gradient atmosphere */
.auth-layout::before {
  content: '';
  position: fixed;
  inset: 0;
  background: var(--canvas-gradient);
  pointer-events: none;
  z-index: 0;
}

.auth-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 400px;
}

.auth-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-card);
  padding: var(--space-10);
}

.auth-logo {
  text-align: center;
  margin-bottom: var(--space-8);
}

.auth-logo h1 {
  font-size: var(--text-2xl);
  font-weight: var(--weight-semibold);
  color: var(--fg-default);
  margin: 0;
}

.auth-logo h1 span {
  color: var(--accent);
}

.auth-title {
  font-size: var(--text-xl);
  font-weight: var(--weight-medium);
  color: var(--fg-default);
  text-align: center;
  margin: 0 0 var(--space-6) 0;
}

.auth-footer {
  text-align: center;
  margin-top: var(--space-6);
}

.auth-link {
  color: var(--accent);
  text-decoration: none;
  font-size: var(--text-sm);
  transition: color var(--duration-fast);
}

.auth-link:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

/* ============================================================================
   13. STANDALONE PAGES — Install, Login, Success (Full-page centered)
   ============================================================================ */

/* Container with canvas gradient */
.standalone-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--canvas-bg);
  padding: var(--space-8);
  position: relative;
}

.standalone-page::before {
  content: '';
  position: fixed;
  inset: 0;
  background: var(--canvas-gradient);
  pointer-events: none;
  z-index: 0;
}

/* Centered card */
.standalone-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 480px;
  padding: var(--space-8);
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-float-lg);
}

.standalone-card--narrow {
  max-width: 400px;
}

.standalone-card--wide {
  max-width: 560px;
}

/* Header */
.standalone-header {
  text-align: center;
  margin-bottom: var(--space-8);
}

.standalone-logo {
  width: 56px;
  height: 56px;
  margin: 0 auto var(--space-4);
  background: var(--accent);
  border-radius: var(--radius-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--fg-on-accent);
  font-weight: var(--weight-semibold);
  font-size: var(--text-2xl);
}

.standalone-logo--small {
  width: 48px;
  height: 48px;
  font-size: var(--text-xl);
}

.standalone-title {
  font-size: var(--text-2xl);
  font-weight: var(--weight-medium);
  margin: 0 0 var(--space-2);
}

.standalone-subtitle {
  color: var(--fg-muted);
  font-size: var(--text-sm);
  margin: 0;
}

/* Logo with text */
.standalone-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  margin-bottom: var(--space-8);
}

.standalone-brand-text {
  font-size: var(--text-2xl);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-tight);
}

.standalone-brand-text span {
  color: var(--accent);
}

/* Success state */
.standalone-success-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto var(--space-4);
  background: var(--success-subtle);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--success);
}

.standalone-success-icon svg {
  width: 32px;
  height: 32px;
}

/* ============================================================================
   14. LANGUAGE SWITCHER
   ============================================================================ */

.lang-switch {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  display: flex;
  gap: var(--space-2);
}

.lang-btn {
  padding: var(--space-1) var(--space-2);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  color: var(--fg-muted);
  background: transparent;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  cursor: pointer;
  text-decoration: none;
  transition: all var(--duration-fast) var(--ease-out);
}

.lang-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.lang-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--fg-on-accent);
}

/* ============================================================================
   15. FORM SECTIONS
   ============================================================================ */

.form-section {
  margin-bottom: var(--space-6);
}

.form-section:last-child {
  margin-bottom: 0;
}

.form-section-title {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: var(--tracking-caps);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--border-muted);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}

@media (max-width: 500px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

/* ============================================================================
   16. PAGE COMPONENTS (for authenticated pages)
   ============================================================================ */

.page-content {
  width: 100%;
  /* No max-width — responsive full-width */
}

.page-header {
  margin-bottom: var(--space-20); /* 80px - breathing room between header and content */
}

.page-title {
  font-size: var(--text-2xl);
  font-weight: var(--weight-medium);
  margin: 0 0 var(--space-2);
}

.page-subtitle {
  color: var(--fg-muted);
  margin: 0 0 var(--space-10) 0; /* 40px bottom - breathing room to content */
}

/* ============================================================================
   17. EMPTY STATES
   ============================================================================ */

.empty-state {
  text-align: center;
  padding: var(--space-16) var(--space-8);
  color: var(--fg-muted);
}

.empty-state-icon {
  margin-bottom: var(--space-4);
  opacity: 0.5;
}

.empty-state-icon svg {
  width: 48px;
  height: 48px;
  stroke: currentColor;
}

.empty-state-title {
  font-size: var(--text-lg);
  font-weight: var(--weight-medium);
  color: var(--fg-default);
  margin: 0 0 var(--space-2);
}

.empty-state-text {
  margin: 0 0 var(--space-6);
}

/* ============================================================================
   18. MODULE GRID
   ============================================================================ */

.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-6);
}

.module-card {
  padding: var(--space-6);
}

.module-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-3);
}

.module-name {
  font-weight: var(--weight-medium);
}

.module-description {
  color: var(--fg-muted);
  font-size: var(--text-sm);
  margin: 0 0 var(--space-4);
}

.module-meta {
  font-size: var(--text-xs);
  color: var(--fg-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.module-version {
  color: var(--fg-subtle);
}

.module-status {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-xs);
  color: var(--fg-muted);
}

.module-status--locked {
  color: var(--fg-subtle);
}

.module-status--locked svg {
  opacity: 0.6;
}

/* Module Sections */
.module-section {
  margin-bottom: var(--space-8);
}

.module-section:last-child {
  margin-bottom: 0;
}

.module-section-title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  color: var(--fg-default);
  margin: 0 0 var(--space-2);
}

.module-section-title svg {
  color: var(--accent);
  opacity: 0.8;
}

.module-section-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 var(--space-2);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  color: var(--fg-muted);
  background: var(--bg-muted);
  border-radius: var(--radius-full);
}

.module-section-desc {
  font-size: var(--text-sm);
  color: var(--fg-muted);
  margin: 0 0 var(--space-4);
}

/* Core Module Card */
.module-card--core {
  /* Core modules: no left border, subtle border instead */
  border: 1px solid var(--border-muted);
}

.module-card--core .badge-accent {
  background: hsl(var(--accent-h) var(--accent-s) var(--accent-l) / 0.15);
  color: var(--accent);
}

/* Custom Module Card */
.module-card--custom {
  border-left: 3px solid var(--warning);
}

/* Module Actions */
.module-actions {
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  gap: var(--space-2);
}

/* ============================================================================
   19. SETTINGS LAYOUT
   ============================================================================ */

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: var(--space-6);
  width: 100%;
  align-items: start;
}

.settings-card {
  padding: var(--space-6);
}

.settings-section-title {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: var(--tracking-caps);
  margin: 0 0 var(--space-4);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--border-muted);
}

.settings-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-3) 0;
}

.settings-item:not(:last-child) {
  border-bottom: 1px solid var(--border-subtle);
}

.settings-label {
  color: var(--fg-default);
  font-size: var(--text-sm);
}

.settings-value {
  color: var(--fg-muted);
  font-size: var(--text-sm);
}

/* ============================================================================
   20. BADGE VARIANTS
   ============================================================================ */

.badge {
  display: inline-flex;
  align-items: center;
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-full);
}

.badge-primary {
  background: var(--accent-subtle);
  color: var(--accent);
}

.badge-success {
  background: var(--success-subtle);
  color: var(--success);
}

.badge-warning {
  background: var(--warning-subtle);
  color: var(--warning);
}

.badge-error {
  background: var(--error-subtle);
  color: var(--error);
}

.badge-muted {
  background: var(--bg-subtle);
  color: var(--fg-muted);
}

/* ============================================================================
   21. BUTTON VARIANTS
   ============================================================================ */

/* .btn-sm already defined above - removed duplicate */

.btn-lg {
  padding: var(--space-4) var(--space-6);
  font-size: var(--text-lg);
}

.btn-block {
  display: block;
  width: 100%;
}

/* Button group */
.btn-group {
  display: flex;
  gap: var(--space-2);
}

/* Ensure links as buttons don't inherit link colors */
a.btn,
a.btn:visited,
a.btn:hover,
a.btn:focus,
a.btn:active {
  text-decoration: none;
}

a.btn:hover {
  color: inherit;
}

/* ============================================================================
   22. WELCOME PAGE (Plugin Registry)
   ============================================================================ */

.welcome-hero {
  text-align: center;
  padding: var(--space-12) var(--space-8);
  background: linear-gradient(135deg, var(--accent-subtle) 0%, var(--bg-surface) 100%);
  border-radius: var(--radius-2xl);
  margin-bottom: var(--space-8);
}

.welcome-hero-title {
  font-size: var(--text-3xl);
  font-weight: var(--weight-light);
  margin: 0 0 var(--space-4);
}

.welcome-hero-subtitle {
  font-size: var(--text-lg);
  color: var(--fg-muted);
  margin: 0;
}

.plugin-tabs {
  display: flex;
  gap: var(--space-2);
  border-bottom: 1px solid var(--border-muted);
  margin-bottom: var(--space-6);
}

.plugin-tab {
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--fg-muted);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
}

.plugin-tab:hover {
  color: var(--fg-default);
}

.plugin-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.plugin-list {
  display: grid;
  gap: var(--space-4);
}

.plugin-item {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4);
  background: var(--bg-surface);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius-xl);
  transition: all var(--duration-fast) var(--ease-out);
}

.plugin-item:hover {
  border-color: var(--border-emphasis);
  box-shadow: var(--shadow-card-hover);
}

.plugin-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xl);
  flex-shrink: 0;
}

.plugin-info {
  flex: 1;
  min-width: 0;
}

.plugin-name {
  font-weight: var(--weight-medium);
  margin: 0 0 var(--space-1);
}

.plugin-description {
  font-size: var(--text-sm);
  color: var(--fg-muted);
  margin: 0;
}

.plugin-action {
  flex-shrink: 0;
}

/* ============================================================================
   23. ALERT SPACING FIX
   ============================================================================ */

.alert + .form-group,
.alert + .form-section {
  margin-top: var(--space-6);
}

/* ============================================================================
   24. TOPBAR / NAVIGATION TYPOGRAPHY (compact for many items)
   ============================================================================ */

.nav-compact .nav-text {
  font-size: var(--text-sm);
}

.nav-compact .nav-icon {
  width: 18px;
  height: 18px;
}

/* Section labels in sidebar — matches dropdown-section-title exactly */
.app-sidebar .nav-section-label {
  display: block;
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--fg-subtle);
  text-transform: uppercase;
  letter-spacing: var(--tracking-caps);
  /* Aligned with nav-link text */
  padding: var(--space-2) var(--space-3);
  margin-bottom: var(--space-1);
}

/* Reset list styles in sidebar nav — compact like dropdown */
.sidebar-nav ul,
.sidebar-nav li {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* ============================================================================
   25. MODULE-FIRST TOPBAR
   ============================================================================ */

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--topbar-height, 60px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-6);
  background: transparent;
  border-bottom: 1px solid transparent;
  z-index: var(--z-sticky);
}

/* When scrolled: Add glass effect, border and shadow */
.topbar.is-scrolled {
  background: var(--glass-bg-topbar);
  border-bottom-color: var(--glass-border);
  box-shadow: var(--shadow-float);
  -webkit-backdrop-filter: blur(var(--glass-blur-lg)) saturate(var(--glass-saturate-lg));
  backdrop-filter: blur(var(--glass-blur-lg)) saturate(var(--glass-saturate-lg));
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: var(--space-8);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

/* Brand */
.topbar-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  color: var(--fg-default);
}

.topbar-brand-icon {
  width: 32px;
  height: 32px;
  background: var(--accent);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--fg-on-accent);
  font-weight: var(--weight-semibold);
  font-size: var(--text-sm);
}

.topbar-brand-text {
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-tight);
}

/* Logo Text with two-tone style */
.topbar-logo-text {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.topbar-logo-text span {
  color: var(--fg-muted);
  font-weight: 400;
}

.topbar-logo-img {
  height: 20px;
  width: auto;
}

/* Module Tabs in Topbar */
.topbar-modules {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  margin-left: var(--space-6);
  padding-left: var(--space-6);
  border-left: 1px solid var(--border-muted);
}

.topbar-module-tab {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--fg-muted);
  text-decoration: none;
  border-radius: var(--radius-md);
  transition: all var(--duration-fast) var(--ease-out);
}

.topbar-module-tab:hover {
  color: var(--fg-default);
  background: var(--bg-subtle);
}

.topbar-module-tab.active {
  color: var(--accent);
  background: var(--accent-subtle);
}

/* ─────────────────────────────────────────────────────────────────────────────
   Module Pills Navigation (Center) — Segmented Control Style
   ───────────────────────────────────────────────────────────────────────────── */

.topbar-nav {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.topbar-nav-pills {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: var(--space-1);
  background: var(--bg-pills);
  border-radius: var(--radius-full);
}

.topbar-pill {
  display: flex;
  align-items: center;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--fg-muted);
  text-decoration: none;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
}

/* Hover: Subtle translucent background (only when not active) */
.topbar-pill:not(.active):hover {
  background: var(--bg-pill-hover);
  color: var(--fg-default);
}

/* Active: Fixed white/dark background — always visible */
.topbar-pill.active {
  background: var(--bg-pill-active);
  color: var(--fg-default);
  font-weight: var(--weight-semibold);
  box-shadow: var(--shadow-sm);
}

/* More button for overflow */
.topbar-pill--more {
  padding: var(--space-2);
}

.topbar-pill--more svg {
  width: 18px;
  height: 18px;
}

/* System Menu Button */
.topbar-system-menu {
  position: relative;
}

.topbar-system-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: transparent;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  color: var(--fg-muted);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
}

.topbar-system-btn:hover {
  background: var(--bg-subtle);
  border-color: var(--border-emphasis);
  color: var(--fg-default);
}

.topbar-system-btn[aria-expanded="true"] {
  background: var(--bg-subtle);
  border-color: var(--accent);
  color: var(--accent);
}

/* Dropdown — Glass Effect like Topbar */
/* Dropdown styles moved to liquid-glass.css - this is just padding */
.topbar-dropdown {
  padding: var(--space-2);
}

.dropdown-section {
  padding: var(--space-2);
}

.dropdown-section-title {
  display: block;
  font-size: 10px;
  font-weight: var(--weight-semibold);
  color: var(--fg-subtle);
  text-transform: uppercase;
  letter-spacing: var(--tracking-caps);
  padding: var(--space-1) var(--space-2);
  margin-bottom: var(--space-1);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  color: var(--fg-default);
  text-decoration: none;
  border-radius: var(--radius-md);
  transition: all var(--duration-fast) var(--ease-out);
}

.dropdown-item:hover {
  background: var(--bg-subtle);
}

.dropdown-item.active {
  background: var(--accent-subtle);
  color: var(--accent);
}

.dropdown-item--danger {
  color: var(--error);
}

.dropdown-item--danger:hover {
  background: var(--error-subtle);
}

.dropdown-divider {
  height: 1px;
  background: var(--border-muted);
  margin: var(--space-2);
}

/* ─────────────────────────────────────────────────────────────────────────────
   Dropdown Enhancements — User Header, Activities
   ───────────────────────────────────────────────────────────────────────────── */

.dropdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-muted);
  background: var(--bg-muted);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.dropdown-header--user {
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-1);
}

.dropdown-title {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--fg-default);
}

.dropdown-link {
  font-size: var(--text-xs);
  color: var(--accent);
}

.dropdown-link:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

.dropdown-user-info {
  display: flex;
  flex-direction: column;
}

.dropdown-user-email {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--fg-default);
}

.dropdown-user-role {
  font-size: var(--text-xs);
  color: var(--fg-muted);
}

/* Role Badges */
.role-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.5rem;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: none;
}

.role-badge--super_admin {
  background: #1a1a2e;
  color: #ffffff;
}

.role-badge--admin {
  background: var(--accent-100, rgba(16, 185, 129, 0.1));
  color: var(--accent, var(--success-600));
}

.role-badge--user {
  background: var(--bg-subtle);
  color: var(--fg-muted);
}

.dropdown-body {
  max-height: 320px;
  overflow-y: auto;
}

.dropdown-footer {
  padding: var(--space-2) var(--space-4);
  border-top: 1px solid var(--border-muted);
  text-align: center;
}

.dropdown-footer-link {
  font-size: var(--text-sm);
  color: var(--accent);
}

.dropdown-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-8) var(--space-4);
  text-align: center;
  color: var(--fg-subtle);
}

.dropdown-empty svg {
  opacity: 0.4;
}

/* ─────────────────────────────────────────────────────────────────────────────
   Topbar Widgets — Activities, Settings
   ───────────────────────────────────────────────────────────────────────────── */

.topbar-widget {
  position: relative;
}

.topbar-widget-btn {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--bg-subtle);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius-full);
  color: var(--fg-muted);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
  position: relative;
}

.topbar-widget-btn:hover {
  background: var(--bg-emphasis);
  color: var(--fg-default);
  border-color: var(--border-default);
}

.topbar-widget-label {
  display: none;
}

@media (min-width: 768px) {
  .topbar-widget-label {
    display: inline;
  }
}

.topbar-widget-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: var(--accent);
  color: var(--fg-on-accent);
  font-size: 11px;
  font-weight: var(--weight-semibold);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
}

.topbar-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: transparent;
  border: none;
  border-radius: var(--radius-lg);
  color: var(--fg-muted);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
}

.topbar-icon-btn:hover {
  background: var(--bg-subtle);
  color: var(--fg-default);
}

.topbar-icon-btn svg {
  width: 20px;
  height: 20px;
}

/* Theme Toggle Icons */
.theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-moon { display: block; }

/* ─────────────────────────────────────────────────────────────────────────────
   Activity Items — Notification List
   ───────────────────────────────────────────────────────────────────────────── */

.activity-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-muted);
  transition: background var(--duration-fast) var(--ease-out);
}

.activity-item:last-child {
  border-bottom: none;
}

.activity-item:hover {
  background: var(--bg-subtle);
}

.activity-item--unread {
  background: var(--accent-subtle);
}

.activity-item--unread:hover {
  background: var(--accent-muted);
}

.activity-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

.activity-icon--info {
  background: var(--info-subtle);
  color: var(--info);
}

.activity-icon--success {
  background: var(--success-subtle);
  color: var(--success);
}

.activity-icon--warning {
  background: var(--warning-subtle);
  color: var(--warning);
}

.activity-icon--error {
  background: var(--error-subtle);
  color: var(--error);
}

.activity-content {
  flex: 1;
  min-width: 0;
}

.activity-title {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--fg-default);
  margin-bottom: var(--space-0\.5);
}

.activity-message {
  font-size: var(--text-xs);
  color: var(--fg-muted);
  margin-bottom: var(--space-1);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.activity-meta {
  font-size: var(--text-xs);
  color: var(--fg-subtle);
}

.activity-actions {
  display: flex;
  gap: var(--space-1);
  opacity: 0;
  transition: opacity var(--duration-fast) var(--ease-out);
}

.activity-item:hover .activity-actions {
  opacity: 1;
}

.activity-action {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--bg-surface);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius-md);
  color: var(--fg-muted);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
}

.activity-action:hover {
  background: var(--bg-subtle);
  border-color: var(--border-default);
  color: var(--fg-default);
}

.activity-action--danger:hover {
  background: var(--error-subtle);
  border-color: var(--error);
  color: var(--error);
}

/* User Badge */
.topbar-user {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.topbar-user-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
}

.topbar-user-avatar {
  width: 36px;
  height: 36px;
  background: var(--accent);
  color: var(--fg-on-accent);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: var(--weight-semibold);
  font-size: var(--text-sm);
  transition: all var(--duration-fast) var(--ease-out);
  overflow: hidden;
}

.topbar-user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.topbar-user-btn:hover .topbar-user-avatar {
  box-shadow: 0 0 0 2px var(--bg-surface), 0 0 0 4px var(--accent);
}

.topbar-user-email {
  font-size: var(--text-sm);
  color: var(--fg-muted);
}

/* Topbar Dropdown — User Menu */
.topbar-dropdown--user {
  min-width: 240px;
}

.topbar-dropdown--activities {
  min-width: 360px;
  right: 0;
}

/* ============================================================================
   26. MAIN CONTENT LAYOUT (Module-first)
   ============================================================================ */

.app-layout.no-modules .app-main {
  margin-left: 0;
  padding-top: var(--topbar-height, 60px);
}

.app-layout.has-modules .app-main {
  margin-left: var(--sidebar-width, 240px);
  padding-top: var(--topbar-height, 60px);
}

.app-main.no-sidebar {
  margin-left: 0;
}

.app-main.with-sidebar {
  margin-left: var(--sidebar-width, 240px);
}

/* Sidebar in module-first layout */
.app-layout.has-modules .app-sidebar {
  top: 0;  /* Always start from browser top */
  height: 100vh;
}

.app-layout.no-modules .app-sidebar {
  display: none;
}

/* ============================================================================
   SIDEBAR NAV LINKS — Consistent with Dropdown Menu
   ============================================================================ */

.app-sidebar .nav-item {
  margin-bottom: 4px; /* Small gap between items */
}

.app-sidebar .nav-link {
  display: flex;
  align-items: center;
  gap: var(--space-3); /* 12px - same as dropdown-item */
  padding: var(--space-2) var(--space-3); /* 8px 12px - same as dropdown-item */
  width: 100%; /* Full width */
  box-sizing: border-box;
  color: var(--fg-default); /* Same as dropdown-item */
  text-decoration: none;
  font-size: var(--text-sm);
  font-weight: var(--weight-normal);
  border-radius: var(--radius-md); /* Same as dropdown-item */
  transition: all var(--duration-fast) var(--ease-out);
}

.app-sidebar .nav-link:hover {
  color: var(--fg-default);
  background: var(--bg-subtle); /* Same as dropdown-item:hover */
}

/* Active state — Accent color with 20% opacity */
.app-sidebar .nav-link.active {
  background: color-mix(in srgb, var(--accent) 20%, transparent);
  color: var(--accent);
}

.app-sidebar .nav-link .nav-icon {
  color: inherit; /* Same color as text */
  opacity: 1;
}

/* Sidebar nav icons match dropdown icon style: 1.5 stroke, 16px */
.app-sidebar .nav-link .nav-icon svg {
  width: 16px;
  height: 16px;
  stroke-width: 1.5;
}

.app-sidebar .nav-link:hover .nav-icon {
  color: inherit; /* Same color as text */
}

.app-sidebar .nav-link.active .nav-icon {
  color: inherit; /* Same color as text (accent) */
}

/* Compact nav links */
.nav-link--compact {
  padding: var(--space-2) var(--space-3);
}

.nav-link--compact .nav-text {
  font-size: var(--text-sm);
}

.nav-link--compact .nav-icon {
  width: 16px;
  height: 16px;
}

.nav-link--compact .nav-icon svg {
  width: 100%;
  height: 100%;
}

/* ============================================================================
   27. ICON SIZING
   ============================================================================ */

.nav-icon {
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Ensure sidebar nav icons are exactly 16x16 like dropdown */
.app-sidebar .nav-icon svg {
  width: 16px;
  height: 16px;
}

.nav-icon svg {
  width: 100%;
  height: 100%;
}

/* ============================================================================
   28. USER LIST COMPONENTS
   ============================================================================ */

.user-cell {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: var(--accent);
  color: var(--fg-on-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  flex-shrink: 0;
}

/* ============================================================================
   29. FORM ACTIONS
   ============================================================================ */

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
  margin-top: var(--space-6);
  padding-top: var(--space-6);
  border-top: 1px solid var(--border-muted);
}

/* ============================================================================
   30. PAGE HEADER ENHANCED
   ============================================================================ */

.page-header-content {
  flex: 1;
}

.page-header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.page-header-actions .btn svg {
  margin-right: var(--space-2);
}

/* ============================================================================
   31. COMMON HELPERS
   ============================================================================ */

.text-center { text-align: center; }

/* ============================================================================
   32. TOPBAR MODULE TABS
   ============================================================================ */

.topbar-modules {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  margin-left: var(--space-6);
}

.topbar-module-tab {
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--fg-muted);
  text-decoration: none;
  transition: all var(--duration-fast) var(--ease-out);
}

.topbar-module-tab:hover {
  color: var(--fg-default);
  background: var(--hover-bg);
}

.topbar-module-tab.active {
  color: var(--accent);
  background: var(--accent-subtle);
}
/* ============================================================================
   33. NOTIFICATIONS
   ============================================================================ */

.notifications-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.notification-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  padding: var(--space-4);
  background: var(--bg-surface);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  transition: all var(--duration-fast) var(--ease-out);
}

.notification-item:hover {
  box-shadow: var(--shadow-card-hover);
}

.notification-item.notification--unread {
  background: var(--accent-subtle);
  border-color: var(--accent-muted);
}

/* Notification icon */
.notification-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.notification-icon svg {
  width: 20px;
  height: 20px;
}

/* Type variants */
.notification--info .notification-icon {
  background: var(--info-subtle);
  color: var(--info);
}

.notification--success .notification-icon {
  background: var(--success-subtle);
  color: var(--success);
}

.notification--warning .notification-icon {
  background: var(--warning-subtle);
  color: var(--warning);
}

.notification--error .notification-icon {
  background: var(--danger-subtle);
  color: var(--danger);
}

.notification--update .notification-icon {
  background: var(--accent-subtle);
  color: var(--accent);
}

/* Content */
.notification-content {
  flex: 1;
  min-width: 0;
}

.notification-title {
  font-weight: var(--weight-medium);
  color: var(--fg-default);
  margin-bottom: var(--space-1);
}

.notification-message {
  font-size: var(--text-sm);
  color: var(--fg-muted);
  margin-bottom: var(--space-2);
}

.notification-meta {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-xs);
  color: var(--fg-subtle);
}

.notification-type {
  padding: var(--space-0-5) var(--space-2);
  background: var(--bg-muted);
  border-radius: var(--radius-sm);
}

/* Actions */
.notification-actions {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  flex-shrink: 0;
}

.btn-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--fg-muted);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
}

.btn-icon:hover {
  background: var(--hover-bg);
  color: var(--fg-default);
}

.btn-icon--danger:hover {
  background: var(--danger-subtle);
  color: var(--danger);
}

.inline-form {
  display: inline;
}

/* Empty state card */
.empty-state-card {
  padding: var(--space-12);
  text-align: center;
}

/* Page actions */
.page-actions {
  display: flex;
  gap: var(--space-2);
}

/* Text danger */
.text-danger {
  color: var(--danger);
}

.text-danger:hover {
  color: var(--danger-hover);
}

/* ============================================================================
   34. NOTIFICATION BELL (Topbar Widget)
   ============================================================================ */

.notification-bell {
  position: relative;
}

.notification-bell-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--fg-muted);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
}

.notification-bell-btn:hover {
  background: var(--hover-bg);
  color: var(--fg-default);
}

.notification-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  padding: 0 var(--space-1);
  background: var(--danger);
  color: white;
  font-size: 10px;
  font-weight: var(--weight-bold);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
}

.notification-badge:empty {
  display: none;
}

/* ============================================================================
   35. MODULE GRID — Dashboard Card Layout (from design-system.css)
   ============================================================================ */

.module-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-5);
  margin-bottom: var(--space-8);
}

@media (max-width: 1200px) {
  .module-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .module-grid {
    grid-template-columns: 1fr;
  }
}

.module-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-lg);
  font-size: var(--text-lg);
}

.module-icon--sales {
  background: rgba(139, 92, 246, 0.1);
  color: var(--color-sales);
}

.module-icon--redaktion {
  background: rgba(16, 185, 129, 0.1);
  color: var(--color-redaktion);
}

.module-icon--vertrieb {
  background: rgba(59, 130, 246, 0.1);
  color: var(--color-vertrieb);
}

.module-info h3 {
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  color: var(--fg-default);
  margin-bottom: 2px;
}

.module-info span {
  font-size: var(--text-xs);
  color: var(--fg-subtle);
}

.module-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-2);
  margin: var(--space-4) var(--space-5);
  padding: var(--space-3);
  background: var(--bg-muted);
  border-radius: var(--radius-lg);
}

.stat-item {
  text-align: center;
}

.stat-value {
  font-size: var(--text-xl);
  font-weight: var(--weight-semibold);
  color: var(--fg-default);
}

.stat-label {
  font-size: 9px;
  font-weight: var(--weight-semibold);
  color: var(--fg-subtle);
  text-transform: uppercase;
  letter-spacing: var(--tracking-caps);
}

/* ============================================================================
   36. SEARCH BOX — Hero Search Input
   ============================================================================ */

.search-box {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  max-width: 600px;
  margin-top: var(--space-6);
  padding: var(--space-3) var(--space-4);
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  transition: all var(--duration-fast) var(--ease-out);
}

.search-box:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-subtle);
}

.search-box > svg {
  width: 20px;
  height: 20px;
  color: var(--fg-subtle);
  flex-shrink: 0;
}

.search-box input {
  flex: 1;
  border: none;
  background: transparent;
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  color: var(--fg-default);
  outline: none;
}

.search-box input::placeholder {
  color: var(--fg-subtle);
}

/* ============================================================================
   37. CHARTS — Bar & Pie Charts (from design-system.css)
   ============================================================================ */

.charts-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--space-5);
}

@media (max-width: 1200px) {
  .charts-grid {
    grid-template-columns: 1fr;
  }
}

.chart-area {
  height: 200px;
  position: relative;
  display: flex;
  align-items: flex-end;
  padding: var(--space-5);
  padding-bottom: 0;
}

.chart-y-axis {
  position: absolute;
  left: var(--space-5);
  top: var(--space-5);
  bottom: var(--space-8);
  width: 60px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-size: 11px;
  color: var(--fg-subtle);
}

.chart-bars {
  flex: 1;
  margin-left: 68px;
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 100%;
}

.chart-bar {
  flex: 1;
  background: linear-gradient(180deg, var(--accent) 0%, hsla(var(--accent-h), var(--accent-s), var(--accent-l), 0.6) 100%);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  min-height: 4px;
  transition: filter var(--duration-fast) var(--ease-out);
}

.chart-bar:hover {
  filter: brightness(1.1);
}

.chart-x-axis {
  display: flex;
  justify-content: space-between;
  padding: var(--space-3) var(--space-5);
  padding-left: calc(var(--space-5) + 68px);
  font-size: 11px;
  color: var(--fg-subtle);
}

.pie-chart-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-8);
  padding: var(--space-5);
}

.pie-chart {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: conic-gradient(
    var(--color-sales) 0deg 120deg,
    var(--color-redaktion) 120deg 240deg,
    var(--color-vertrieb) 240deg 360deg
  );
  position: relative;
}

.pie-chart::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 70px;
  height: 70px;
  background: var(--bg-surface);
  border-radius: 50%;
}

.pie-legend {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--fg-muted);
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.legend-dot--sales { background: var(--color-sales); }
.legend-dot--redaktion { background: var(--color-redaktion); }
.legend-dot--vertrieb { background: var(--color-vertrieb); }

/* ============================================================================
   38. GREETING HEADER — Dashboard Hero
   ============================================================================ */

.greeting {
  font-size: var(--text-3xl);
  font-weight: var(--weight-semibold);
  color: var(--fg-default);
  letter-spacing: var(--tracking-tight);
  margin-bottom: var(--space-1);
}

.date-display {
  font-size: var(--text-sm);
  color: var(--fg-muted);
}

/* ============================================================================
   39. SECTION HEADER — With Icon
   ============================================================================ */

.section-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}

.section-header svg {
  width: 20px;
  height: 20px;
  color: var(--fg-muted);
}

/* ============================================================================
   40. RESPONSIVE TOPBAR
   ============================================================================ */

@media (max-width: 1024px) {
  .topbar-nav {
    position: static;
    transform: none;
  }
}

@media (max-width: 768px) {
  .topbar-nav-pills {
    display: none;
  }
}

/* ============================================================================
   41. APP FOOTER — Always at bottom of content (not fixed)
   ============================================================================ */

.app-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-4) var(--space-8);
  margin-top: auto;
  background: transparent;
  color: var(--fg-subtle);
  font-size: 11px;
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 2px;
}

.footer-heart {
  color: var(--fg-muted);
  vertical-align: middle;
  margin: 0 1px;
}

.footer-right {
  color: var(--fg-muted);
  font-size: 11px;
}

@media (max-width: 640px) {
  .app-footer {
    flex-direction: column;
    gap: var(--space-2);
    text-align: center;
    padding: var(--space-4);
  }
}

/* ============================================================================
   42. SETTINGS PAGE FIXES
   ============================================================================ */

/* ============================================================================
   SETTINGS PAGE — Clean 2-Column Layout
   ============================================================================ */

.settings-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-6);
  align-items: start;
}

.settings-column {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

/* Card Header */
.settings-card-header {
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border-muted);
}

.settings-card-title {
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  color: var(--fg-default);
  margin: 0 0 var(--space-1);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.settings-card-title svg {
  color: var(--accent);
  flex-shrink: 0;
}

.settings-card-subtitle {
  font-size: var(--text-sm);
  color: var(--fg-muted);
  margin: 0;
}

/* Settings Sections within Card */
.settings-section {
  margin-bottom: var(--space-5);
}

.settings-section:last-child {
  margin-bottom: 0;
}

.settings-section-label {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: var(--tracking-caps);
  margin: 0 0 var(--space-3);
}

.settings-actions {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-default);
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
  margin: var(--space-4) calc(var(--space-6) * -1) calc(var(--space-6) * -1);
}

/* Form Grid */
.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}

/* Appearance Grid (Logo + Color side by side) */
.appearance-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-6);
}

.appearance-section {
  display: flex;
  flex-direction: column;
}

/* Color Form */
.color-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.color-picker-row {
  display: flex;
  gap: var(--space-2);
  align-items: center;
}

.color-picker-row .input {
  flex: 1;
  min-width: 0;
}

/* Form Hint */
.form-hint {
  font-size: var(--text-xs);
  color: var(--fg-muted);
  margin-top: var(--space-2);
}

/* Responsive */
@media (max-width: 1024px) {
  .settings-layout {
    grid-template-columns: 1fr;
  }
  
  .appearance-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .form-grid-2 {
    grid-template-columns: 1fr;
  }
}

/* Form grid inside settings cards */
.settings-form .form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-4);
}

.settings-form .form-group--full {
  grid-column: 1 / -1;
}

.settings-form .form-actions {
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border-muted);
}

/* Color picker row */
.color-picker-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.color-input {
  width: 48px;
  height: 40px;
  padding: var(--space-1);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  cursor: pointer;
  background: transparent;
}

.color-input::-webkit-color-swatch-wrapper {
  padding: 0;
}

.color-input::-webkit-color-swatch {
  border: none;
  border-radius: var(--radius-sm);
}

.color-presets {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.color-preset {
  width: 28px;
  height: 28px;
  border: 2px solid transparent;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--duration-fast);
}

.color-preset:hover {
  transform: scale(1.1);
  border-color: var(--fg-muted);
}

/* Logo upload area */
.logo-upload {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.logo-preview {
  position: relative;
  width: 100%;
  max-width: 200px;
  aspect-ratio: 3 / 1;
  border: 2px dashed var(--border-default);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--bg-muted);
  transition: all var(--duration-fast);
}

.logo-upload.dragging .logo-preview {
  border-color: var(--accent);
  background: var(--bg-accent-subtle);
}

.logo-preview img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.logo-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  color: var(--fg-muted);
  font-size: var(--text-sm);
}

.logo-delete {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
  padding: var(--space-1);
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-full);
  cursor: pointer;
  color: var(--fg-muted);
  transition: all var(--duration-fast);
}

.logo-delete:hover {
  background: var(--error);
  color: white;
  border-color: var(--error);
}

/* Form hint text */
.form-hint {
  font-size: var(--text-sm);
  color: var(--fg-muted);
  margin-bottom: var(--space-4);
}

/* Button secondary style fix */
.btn-secondary {
  background: var(--bg-surface);
  color: var(--fg-default);
  border: 1px solid var(--border-default);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--bg-muted);
  border-color: var(--border-emphasis);
}

@media (max-width: 640px) {
  .settings-grid {
    grid-template-columns: 1fr;
  }
  
  .settings-form .form-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================================================
   USERS MODULE — User Management Table
   ============================================================================ */

/* Users Card with system shadow */
.users-card {
  background: var(--bg-surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

/* Users Table */
.users-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.users-table th {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-caps);
  color: var(--fg-muted);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-muted);
  text-align: left;
}

.users-table td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-subtle, var(--border-muted));
  vertical-align: middle;
}

.users-table tbody tr:last-child td {
  border-bottom: none;
}

/* User Row */
.user-row {
  transition: background-color var(--duration-fast) var(--ease-out);
}

.user-row:hover {
  background: var(--row-hover-bg);
}

/* User Avatar in Table */
.user-avatar--table {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--accent);
  color: var(--fg-on-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  overflow: hidden;
  flex-shrink: 0;
}

.user-avatar--table img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* User Name & Email */
.user-name {
  font-weight: var(--weight-medium);
  color: var(--fg-default);
}

.user-email {
  color: var(--fg-muted);
  font-size: var(--text-sm);
}

/* Action Icons */
.action-icons {
  display: flex;
  gap: var(--space-1);
  justify-content: flex-end;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  border-radius: var(--radius-md);
  color: var(--fg-muted);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
}

/* Icon button SVG stroke weight — thinner for refined look */
.icon-btn svg,
.icon-btn svg path,
.icon-btn svg line,
.icon-btn svg circle,
.icon-btn svg polyline,
.icon-btn svg rect {
  stroke-width: var(--icon-stroke-md) !important; /* 1.5 for 18px icons */
}

.icon-btn:hover {
  background: var(--bg-muted);
  color: var(--fg-default);
}

.icon-btn--danger:hover {
  background: var(--error-subtle);
  color: var(--error);
}

.inline-delete-form {
  display: inline;
}

/* Add User Button — Dashed Border Style */
.add-user-row td {
  padding: var(--space-2) var(--space-4);
  border-bottom: none;
}

.btn-add-user {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border: 1px dashed var(--border-emphasis);
  background: transparent;
  border-radius: var(--radius-lg);
  color: var(--fg-muted);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
}

.btn-add-user:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-subtle);
}

.btn-add-user svg {
  width: 16px;
  height: 16px;
}

/* Inline Edit/Create Rows — Contrast Background */
.inline-create-row td,
.inline-edit-row td {
  padding: var(--space-5);
  background: var(--bg-emphasis);
  border-bottom: 1px solid var(--border-emphasis);
}

/* Dark mode: inverted contrast */
[data-theme="dark"] .inline-create-row td,
[data-theme="dark"] .inline-edit-row td {
  background: var(--bg-elevated);
}

.inline-form {
  width: 100%;
}

.inline-fields {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  align-items: flex-end;
}

.inline-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  flex: 1;
  min-width: 120px;
}

.inline-field--email {
  min-width: 180px;
  flex: 1.5;
}

.inline-field--role {
  min-width: 100px;
  flex: 0.8;
}

.inline-field label {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: var(--tracking-caps);
}

.inline-field input {
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  font-size: var(--text-sm);
  color: var(--fg-default);
  transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
}

/* Inline select inherits global select styles, just needs sizing adjustments */
.inline-field select {
  padding-top: var(--space-2);
  padding-bottom: var(--space-2);
  border-radius: var(--radius-md);
}

.inline-field input:focus,
.inline-field select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-subtle);
}

.inline-field input::placeholder {
  color: var(--fg-subtle);
}

.inline-actions {
  display: flex;
  gap: var(--space-2);
  margin-left: auto;
}

/* Inline Row Animation */
.inline-create-row,
.inline-edit-row {
  animation: slideDown var(--duration-normal) var(--ease-out);
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive */
@media (max-width: 768px) {
  .inline-fields {
    flex-direction: column;
  }
  
  .inline-field {
    min-width: 100%;
  }
  
  .inline-actions {
    margin-left: 0;
    width: 100%;
    justify-content: flex-end;
  }
}

/* ============================================================================
   26. MONITORING MODULE — Fresh & Modern
   ============================================================================ */

.monitoring-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-5);
}

.monitoring-card {
  background: var(--bg-surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  border: 1px solid var(--border-muted);
}

.monitoring-card--wide {
  grid-column: span 2;
}

/* Cron UI Styles */
.cron-url-box {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3);
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-4);
}

.cron-url {
  flex: 1;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--fg-default);
  word-break: break-all;
  background: none;
  padding: 0;
}

.cron-setup-hint {
  padding: var(--space-3);
  background: var(--bg-muted);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
}

.cron-setup-hint strong {
  display: block;
  margin-bottom: var(--space-2);
  color: var(--fg-muted);
}

.cron-command {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--fg-default);
  word-break: break-all;
}

.cron-jobs-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.cron-job-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-4);
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  transition: opacity var(--duration-fast) var(--ease-out);
}

.cron-job-item--disabled {
  opacity: 0.6;
}

.cron-job-info {
  flex: 1;
  min-width: 0;
}

.cron-job-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-1);
}

.cron-job-id {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--fg-default);
}

.cron-job-description {
  font-size: var(--text-sm);
  color: var(--fg-muted);
  margin: 0 0 var(--space-2);
}

.cron-job-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  font-size: var(--text-xs);
  color: var(--fg-subtle);
}

.cron-job-meta span {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}

.cron-job-meta svg {
  opacity: 0.7;
}

.cron-job-actions {
  display: flex;
  gap: var(--space-2);
  flex-shrink: 0;
}

.badge-muted {
  background: var(--bg-muted);
  color: var(--fg-muted);
}

.monitoring-card .card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border-subtle);
}

.monitoring-card .card-header-left {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-shrink: 0;
}

.monitoring-card .card-header-left svg {
  color: var(--accent);
  opacity: 0.8;
}

.monitoring-card .card-title {
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  color: var(--fg-default);
  margin: 0;
}

.monitoring-card .card-body {
  padding: var(--space-5);
}

/* Status Badge (Header) */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  border-radius: var(--radius-full);
}

.status-badge--ok {
  background: hsl(152 69% 50% / 0.12);
  color: hsl(152 69% 35%);
}

.status-badge--warning {
  background: hsl(38 92% 55% / 0.12);
  color: hsl(38 92% 40%);
}

.status-badge--error {
  background: hsl(0 72% 55% / 0.12);
  color: hsl(0 72% 45%);
}

/* Status Grid — 2x2 */
.status-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
}

/* Status Item — Liquid Glass Style */
.status-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4);
  background: transparent;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-default);
}

.status-item .status-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-lg);
  flex-shrink: 0;
  background: var(--bg-subtle);
  color: var(--fg-muted);
}

.status-item--ok .status-icon {
  color: hsl(152 69% 40%);
}

.status-item--warning .status-icon {
  color: hsl(38 92% 45%);
}

.status-item--error .status-icon {
  color: hsl(0 72% 50%);
}

.status-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  flex: 1;
  min-width: 0;
}

.status-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.status-label {
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.status-value {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--fg-default);
}

.status-detail {
  font-size: var(--text-xs);
  color: var(--fg-subtle);
}

/* Status Bar (Disk Usage) */
.status-bar {
  height: 4px;
  background: var(--bg-muted);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-top: var(--space-2);
  width: 100%;
}

.status-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width var(--duration-normal) var(--ease-out);
  background: var(--accent);
}

.status-bar-fill[data-status="ok"] {
  background: hsl(152 69% 50%);
}

.status-bar-fill[data-status="warning"] {
  background: hsl(38 92% 55%);
}

.status-bar-fill[data-status="error"] {
  background: hsl(0 72% 55%);
}

/* Status Alert — Shows problems inline */
.status-alert {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  margin-top: var(--space-4);
  border-radius: var(--radius-lg);
  background: var(--error-subtle, rgba(239, 68, 68, 0.1));
  border: 1px solid var(--error, rgba(239, 68, 68, 0.3));
}

.status-alert--error {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.25);
}

.status-alert--warning {
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.25);
}

.status-alert-icon {
  flex-shrink: 0;
  color: var(--error, #ef4444);
  margin-top: 2px;
}

.status-alert--warning .status-alert-icon {
  color: var(--warning, #f59e0b);
}

.status-alert-content {
  flex: 1;
  font-size: var(--text-sm);
  color: var(--fg-default);
}

.status-alert-content strong {
  display: block;
  margin-bottom: var(--space-2);
  color: var(--error, #dc2626);
}

.status-alert--warning .status-alert-content strong {
  color: var(--warning, #d97706);
}

.status-alert-list {
  margin: 0;
  padding-left: var(--space-4);
  color: var(--fg-muted);
}

.status-alert-list li {
  margin-bottom: var(--space-1);
}

.status-alert-list code {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  background: rgba(0,0,0,0.05);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}

[data-theme="dark"] .status-alert-list code {
  background: rgba(255,255,255,0.1);
}

/* Backup Actions */
.backup-actions-top {
  margin-bottom: var(--space-4);
  text-align: right;
}

/* Auto-Backup Settings */
.backup-auto-settings {
  margin-top: var(--space-5);
  padding-top: var(--space-5);
  border-top: 1px solid var(--border-subtle);
}

.auto-backup-form {
  display: block;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.toggle-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.toggle-label {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--fg-default);
}

.toggle-description {
  font-size: var(--text-xs);
  color: var(--fg-muted);
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--bg-muted);
  transition: var(--duration-normal) var(--ease-out);
  border-radius: var(--radius-full);
  border: 1px solid var(--border-default);
}

.toggle-slider::before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  transition: var(--duration-normal) var(--ease-out);
  border-radius: 50%;
  box-shadow: var(--shadow-sm);
}

.toggle-switch input:checked + .toggle-slider {
  background-color: hsl(var(--accent-h) var(--accent-s) var(--accent-l));
  border-color: hsl(var(--accent-h) var(--accent-s) calc(var(--accent-l) - 10%));
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(20px);
}

.toggle-switch input:focus + .toggle-slider {
  box-shadow: 0 0 0 2px hsl(var(--accent-h) var(--accent-s) var(--accent-l) / 0.3);
}

/* Backup List */
.backup-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.backup-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  background: var(--bg-default);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
}

.backup-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.backup-name {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--fg-default);
  font-family: var(--font-mono);
}

.backup-meta {
  font-size: var(--text-xs);
  color: var(--fg-muted);
}

.backup-actions {
  display: flex;
  gap: var(--space-2);
}

/* Log List */
.log-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.log-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  background: var(--bg-default);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.log-type {
  display: inline-flex;
  padding: 2px var(--space-2);
  font-size: 10px;
  font-weight: var(--weight-semibold);
  font-family: var(--font-mono);
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  flex-shrink: 0;
}

.log-type--php_error,
.log-type--error {
  background: hsl(0 72% 55% / 0.12);
  color: hsl(0 72% 45%);
}

.log-type--warning {
  background: hsl(38 92% 55% / 0.12);
  color: hsl(38 92% 40%);
}

.log-type--info {
  background: hsl(210 90% 55% / 0.12);
  color: hsl(210 90% 40%);
}

.log-message {
  color: var(--fg-default);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}

/* Info Grid */
.info-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
}

.info-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--space-3);
  background: transparent;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-default);
}

.info-item--wide {
  grid-column: span 3;
}

.info-label {
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  color: var(--fg-muted);
}

.info-value {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--fg-default);
  font-family: var(--font-mono);
}

/* Card Footer Info */
.card-footer-info {
  font-size: var(--text-xs);
  color: var(--fg-muted);
  margin: var(--space-3) 0 0;
  text-align: center;
}

/* Empty State (Small) */
.empty-state--sm {
  padding: var(--space-6) var(--space-4);
  text-align: center;
}

.empty-state--sm svg {
  width: 32px;
  height: 32px;
  margin: 0 auto var(--space-2);
  color: var(--fg-subtle);
}

.empty-state--sm p {
  font-size: var(--text-sm);
  color: var(--fg-muted);
  margin: 0;
}

.empty-state--success svg {
  color: hsl(152 69% 50%);
}

.empty-state--success p {
  color: hsl(152 69% 35%);
}

/* Button Sizes */
.btn-sm {
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  gap: var(--space-1);
}

.btn-sm svg {
  width: 14px;
  height: 14px;
}

/* Inline Form */
.inline-form {
  display: inline-flex;
}

/* Monitoring Responsive */
@media (max-width: 1024px) {
  .monitoring-grid {
    grid-template-columns: 1fr;
  }
  
  .info-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .info-item--wide {
    grid-column: span 2;
  }
}

@media (max-width: 640px) {
  .status-grid {
    grid-template-columns: 1fr;
  }
  
  .info-grid {
    grid-template-columns: 1fr;
  }
  
  .info-item--wide {
    grid-column: span 1;
  }
}

/* ═══════════════════════════════════════════════
   Monitoring Card Fixes
   ═══════════════════════════════════════════════ */

/* Ensure inline-form in card-header doesn't expand to 100% */
.monitoring-card .card-header .inline-form {
  width: auto;
  flex-shrink: 0;
}

/* Icon button in backup actions — square hover background */
.backup-actions .icon-btn {
  border-radius: var(--radius-sm);
}

.backup-actions .icon-btn:hover {
  background: var(--bg-muted);
}

.backup-actions .icon-btn--danger:hover {
  background: var(--error-subtle);
}

