:root {
  --lf-primary: #2f8f4e;
  --lf-primary-dark: #21653a;
  --lf-primary-soft: #e8f5ee;
  --lf-primary-light: #f0f9f3;
  --lf-accent: #f0b35b;
  --lf-accent-dark: #e09c42;
  --lf-bg: #f8f8f5;
  --lf-surface: #ffffff;
  --lf-text-main: #1a2c1f;
  --lf-text-secondary: #3c4a42;
  --lf-text-muted: #66736c;
  --lf-text-light: #8a9990;
  --lf-border: #e0e6e2;
  --lf-border-light: #edf2ef;
  --lf-danger: #c0392b;
  --lf-danger-light: #fdedec;
  --lf-warning: #e67e22;
  --lf-success: #27ae60;
  --lf-radius-xl: 20px;
  --lf-radius-lg: 16px;
  --lf-radius-md: 12px;
  --lf-radius-sm: 8px;
  --lf-shadow-subtle: 0 2px 8px rgba(26, 44, 31, 0.06);
  --lf-shadow-medium: 0 4px 16px rgba(26, 44, 31, 0.08);
  --lf-shadow-elevated: 0 8px 24px rgba(26, 44, 31, 0.12);
  --lf-max-width: 1200px;
  --lf-font-main: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --lf-font-mono: "SF Mono", "Roboto Mono", Menlo, Consolas, monospace;
}

/* Reset and base styles */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--lf-font-main);
  background-color: var(--lf-bg);
  color: var(--lf-text-main);
  line-height: 1.5;
  font-weight: 400;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Typography scale */
h1 {
  font-size: 1.75rem;
  line-height: 1.2;
  font-weight: 700;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}

h2 {
  font-size: 1.5rem;
  line-height: 1.25;
  font-weight: 600;
  margin-bottom: 0.875rem;
}

h3 {
  font-size: 1.25rem;
  line-height: 1.3;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

h4 {
  font-size: 1.125rem;
  line-height: 1.35;
  font-weight: 600;
  margin-bottom: 0.625rem;
}

p {
  font-size: 1rem;
  line-height: 1.5;
  margin-bottom: 1rem;
  color: var(--lf-text-secondary);
}

small {
  font-size: 0.875rem;
  color: var(--lf-text-muted);
}

/* Layout */
.lf-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--lf-bg);
}

.lf-content {
  flex: 1;
  width: 100%;
  max-width: var(--lf-max-width);
  margin: 0 auto;
  padding: 1rem 1rem 5rem; /* Bottom padding for bottom nav */
}

/* Cards */
.lf-card {
  background-color: var(--lf-surface);
  border-radius: var(--lf-radius-lg);
  padding: 1.5rem;
  box-shadow: var(--lf-shadow-medium);
  border: 1px solid var(--lf-border-light);
  margin-bottom: 1rem;
}

.lf-card--compact {
  padding: 1.25rem;
}

.lf-card--spacious {
  padding: 2rem;
}

.lf-card-header {
  margin-bottom: 1.25rem;
  padding-bottom: 0.875rem;
  border-bottom: 1px solid var(--lf-border-light);
}

.lf-card-title {
  margin-bottom: 0.25rem;
}

.lf-card-subtitle {
  color: var(--lf-text-muted);
  font-size: 0.9375rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--lf-radius-lg);
  border: none;
  padding: 0.875rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 3rem;
  text-decoration: none;
  position: relative;
  overflow: hidden;
  gap: 0.5rem;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--lf-primary), var(--lf-primary-dark));
  color: white;
  box-shadow: 0 4px 12px rgba(47, 143, 78, 0.25);
}

.btn-primary:hover {
  box-shadow: 0 6px 16px rgba(47, 143, 78, 0.35);
  transform: translateY(-1px);
}

.btn-primary:active {
  box-shadow: 0 2px 8px rgba(47, 143, 78, 0.3);
}

.btn-secondary {
  background-color: var(--lf-primary-soft);
  color: var(--lf-primary);
  border: 1px solid rgba(47, 143, 78, 0.2);
}

.btn-secondary:hover {
  background-color: rgba(47, 143, 78, 0.1);
  transform: translateY(-1px);
}

.btn-outline {
  background-color: transparent;
  color: var(--lf-primary);
  border: 2px solid var(--lf-primary);
}

.btn-outline:hover {
  background-color: var(--lf-primary-light);
}

.btn-danger {
  background-color: var(--lf-danger);
  color: white;
}

.btn-danger:hover {
  background-color: #a93226;
}

.btn-accent {
  background: linear-gradient(135deg, var(--lf-accent), var(--lf-accent-dark));
  color: white;
}

.btn-full {
  width: 100%;
}

.btn-small {
  padding: 0.625rem 1rem;
  font-size: 0.9375rem;
  min-height: 2.5rem;
}

.btn-icon {
  width: 3rem;
  height: 3rem;
  padding: 0;
  justify-content: center;
  border-radius: var(--lf-radius-md);
}

/* Form elements */
.lf-field {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  margin-bottom: 1.25rem;
}

.lf-label {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--lf-text-main);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.lf-label-optional {
  font-size: 0.8125rem;
  color: var(--lf-text-muted);
  font-weight: 400;
}

.lf-input,
.lf-select,
.lf-textarea {
  border-radius: var(--lf-radius-md);
  border: 2px solid var(--lf-border);
  padding: 0.875rem 1rem;
  font-size: 1rem;
  font-family: inherit;
  background-color: white;
  transition: all 0.2s ease;
  color: var(--lf-text-main);
}

.lf-input::placeholder,
.lf-textarea::placeholder {
  color: var(--lf-text-light);
}

.lf-input:focus,
.lf-select:focus,
.lf-textarea:focus {
  outline: none;
  border-color: var(--lf-primary);
  box-shadow: 0 0 0 3px rgba(47, 143, 78, 0.15);
}

.lf-input-error {
  border-color: var(--lf-danger);
}

.lf-input-error:focus {
  border-color: var(--lf-danger);
  box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.15);
}

.lf-error-message {
  font-size: 0.8125rem;
  color: var(--lf-danger);
  margin-top: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.lf-textarea {
  min-height: 7.5rem;
  resize: vertical;
  line-height: 1.5;
}

/* Chips & tags */
.lf-chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.lf-chip {
  padding: 0.625rem 1rem;
  border-radius: 2rem;
  background-color: white;
  border: 2px solid var(--lf-border);
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--lf-text-secondary);
}

.lf-chip:hover {
  border-color: var(--lf-primary);
  color: var(--lf-primary);
}

.lf-chip--active {
  background-color: var(--lf-primary-soft);
  border-color: var(--lf-primary);
  color: var(--lf-primary);
}

/* Bottom navigation */
.lf-bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  border-top: 1px solid var(--lf-border);
  background-color: white;
  display: flex;
  justify-content: space-around;
  padding: 0.75rem 0;
  z-index: 100;
  box-shadow: 0 -4px 16px rgba(26, 44, 31, 0.08);
}

.lf-bottom-nav__item {
  flex: 1;
  text-align: center;
  color: var(--lf-text-muted);
  text-decoration: none;
  padding: 0.375rem 0;
  transition: color 0.2s ease;
  min-height: 3.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
}

.lf-bottom-nav__item span {
  font-size: 0.75rem;
  font-weight: 500;
}

.lf-bottom-nav__item--active {
  color: var(--lf-primary);
}

.lf-bottom-nav__icon {
  font-size: 1.25rem;
  display: block;
}

/* Toasts & notifications */
.lf-toast-container {
  position: fixed;
  left: 1rem;
  right: 1rem;
  bottom: 5.5rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 28rem;
  margin: 0 auto;
}

.lf-toast {
  padding: 1rem 1.25rem;
  background-color: var(--lf-text-main);
  color: white;
  border-radius: var(--lf-radius-lg);
  font-size: 0.9375rem;
  box-shadow: var(--lf-shadow-elevated);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  animation: slideUp 0.3s ease;
}

.lf-toast-success {
  background-color: var(--lf-primary);
}

.lf-toast-error {
  background-color: var(--lf-danger);
}

.lf-toast-warning {
  background-color: var(--lf-warning);
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(1rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Skeleton loaders */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--lf-border) 25%,
    var(--lf-border-light) 37%,
    var(--lf-border) 63%
  );
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: var(--lf-radius-md);
}

.skeleton-circle {
  border-radius: 50%;
}

.skeleton-rect {
  border-radius: var(--lf-radius-md);
}

.skeleton-text {
  height: 1em;
  margin-bottom: 0.5em;
}

.skeleton-text:last-child {
  margin-bottom: 0;
  width: 80%;
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

/* Tables */
.lf-table-wrapper {
  overflow-x: auto;
  border-radius: var(--lf-radius-md);
  background-color: white;
  box-shadow: var(--lf-shadow-subtle);
  border: 1px solid var(--lf-border-light);
  margin-bottom: 1.5rem;
}

.lf-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.9375rem;
  min-width: 600px;
}

.lf-table thead {
  background-color: var(--lf-primary-light);
}

.lf-table th {
  padding: 1rem 1.25rem;
  border-bottom: 2px solid var(--lf-border);
  text-align: left;
  font-weight: 600;
  color: var(--lf-text-main);
  white-space: nowrap;
}

.lf-table td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--lf-border-light);
  color: var(--lf-text-secondary);
}

.lf-table tbody tr:hover {
  background-color: var(--lf-primary-light);
}

.lf-table tbody tr:last-child td {
  border-bottom: none;
}

/* Badges */
.lf-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1;
}

.lf-badge--success {
  background-color: #d4f1de;
  color: var(--lf-success);
}

.lf-badge--warning {
  background-color: #fef0d7;
  color: var(--lf-warning);
}

.lf-badge--danger {
  background-color: var(--lf-danger-light);
  color: var(--lf-danger);
}

.lf-badge--info {
  background-color: #e8f4fc;
  color: #2980b9;
}

/* Avatars and icons */
.lf-avatar {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--lf-accent), var(--lf-primary));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 1.125rem;
  flex-shrink: 0;
}

.lf-avatar-small {
  width: 2.5rem;
  height: 2.5rem;
  font-size: 1rem;
}

.lf-avatar-large {
  width: 4rem;
  height: 4rem;
  font-size: 1.5rem;
}

.lf-icon-circle {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background-color: var(--lf-primary-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: var(--lf-primary);
}

/* Utility classes */
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.mt-12 { margin-top: 3rem; }
.mt-16 { margin-top: 4rem; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }

.p-0 { padding: 0; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-row { flex-direction: row; }
.flex-wrap { flex-wrap: wrap; }
.flex-nowrap { flex-wrap: nowrap; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.justify-start { justify-content: flex-start; }
.justify-end { justify-content: flex-end; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }
.gap-12 { gap: 3rem; }

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.text-primary { color: var(--lf-primary); }
.text-accent { color: var(--lf-accent); }
.text-danger { color: var(--lf-danger); }
.text-muted { color: var(--lf-text-muted); }
.text-light { color: var(--lf-text-light); }
.text-white { color: white; }

.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-medium { font-weight: 500; }

.rounded-sm { border-radius: var(--lf-radius-sm); }
.rounded-md { border-radius: var(--lf-radius-md); }
.rounded-lg { border-radius: var(--lf-radius-lg); }
.rounded-full { border-radius: 50%; }

.shadow-sm { box-shadow: var(--lf-shadow-subtle); }
.shadow-md { box-shadow: var(--lf-shadow-medium); }
.shadow-lg { box-shadow: var(--lf-shadow-elevated); }

.w-full { width: 100%; }
.h-full { height: 100%; }
.min-h-screen { min-height: 100vh; }

/* Responsive base adjustments */
@media (min-width: 640px) {
  .lf-content {
    padding: 1.5rem 1.5rem 5rem;
  }
  
  .lf-card {
    padding: 1.75rem;
  }
}

@media (min-width: 768px) {
  .lf-content {
    padding: 2rem 2rem 5rem;
  }
  
  .lf-toast-container {
    left: 50%;
    transform: translateX(-50%);
    width: auto;
    max-width: 32rem;
  }
}