:root {
  --ui-ink: #13201a;
  --ui-muted: #66756d;
  --ui-soft: #f4f7f2;
  --ui-panel: rgba(255, 255, 255, 0.82);
  --ui-panel-strong: rgba(255, 255, 255, 0.94);
  --ui-line: rgba(62, 82, 72, 0.14);
  --ui-line-strong: rgba(62, 82, 72, 0.22);
  --ui-brand: #0f8f6f;
  --ui-brand-strong: #08745b;
  --ui-cyan: #0b8aa0;
  --ui-amber: #c47a16;
  --ui-rose: #c2415d;
  --ui-shadow: 0 24px 70px -38px rgba(19, 32, 26, 0.5);
  --ui-shadow-strong: 0 30px 90px -42px rgba(19, 32, 26, 0.68);
}

/* Tailwind CDN fallback for custom project colors. */
.bg-brand-50 { background-color: #ecfdf7 !important; }
.bg-brand-100 { background-color: #d2f7e8 !important; }
.bg-brand-400 { background-color: #39c39d !important; }
.bg-brand-500 { background-color: #0f8f6f !important; }
.bg-brand-600 { background-color: #08745b !important; }
.bg-brand-700 { background-color: #075d4b !important; }
.bg-brand-500\/10 { background-color: rgba(15, 143, 111, 0.1) !important; }
.bg-brand-500\/12 { background-color: rgba(15, 143, 111, 0.12) !important; }
.bg-brand-400\/10 { background-color: rgba(57, 195, 157, 0.1) !important; }
.text-brand-100 { color: #d2f7e8 !important; }
.text-brand-700 { color: #075d4b !important; }
.text-brand-800 { color: #064e3b !important; }
.text-brand-900 { color: #063f35 !important; }
.border-brand-300 { border-color: #72dbbb !important; }
.ring-brand-500 { --tw-ring-color: #0f8f6f !important; }
.ring-brand-500\/20 { --tw-ring-color: rgba(15, 143, 111, 0.2) !important; }
.ring-brand-600\/10 { --tw-ring-color: rgba(8, 116, 91, 0.1) !important; }
.ring-brand-600\/15 { --tw-ring-color: rgba(8, 116, 91, 0.15) !important; }
.focus\:ring-brand-500:focus { --tw-ring-color: #0f8f6f !important; }

.bg-lagoon-50 { background-color: #ecfeff !important; }
.bg-lagoon-500 { background-color: #0b8aa0 !important; }
.bg-lagoon-600 { background-color: #087287 !important; }
.bg-lagoon-500\/12 { background-color: rgba(11, 138, 160, 0.12) !important; }
.text-lagoon-100 { color: #cffafe !important; }
.text-lagoon-600 { color: #087287 !important; }
.text-lagoon-700 { color: #075f70 !important; }
.text-lagoon-800 { color: #064e5c !important; }
.ring-lagoon-500 { --tw-ring-color: #0b8aa0 !important; }
.ring-lagoon-600\/10 { --tw-ring-color: rgba(8, 114, 135, 0.1) !important; }
.ring-lagoon-600\/15 { --tw-ring-color: rgba(8, 114, 135, 0.15) !important; }
.focus\:ring-lagoon-500:focus { --tw-ring-color: #0b8aa0 !important; }

.bg-accent-50 { background-color: #fff8eb !important; }
.bg-accent-500 { background-color: #c47a16 !important; }
.text-accent-600 { color: #a65a0f !important; }
.text-accent-700 { color: #85410f !important; }
.ring-accent-600\/10 { --tw-ring-color: rgba(166, 90, 15, 0.1) !important; }

.from-brand-700 {
  --tw-gradient-from: #075d4b var(--tw-gradient-from-position) !important;
  --tw-gradient-to: rgba(7, 93, 75, 0) var(--tw-gradient-to-position) !important;
  --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to) !important;
}

.from-brand-600 {
  --tw-gradient-from: #08745b var(--tw-gradient-from-position) !important;
  --tw-gradient-to: rgba(8, 116, 91, 0) var(--tw-gradient-to-position) !important;
  --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to) !important;
}

.from-brand-500 {
  --tw-gradient-from: #0f8f6f var(--tw-gradient-from-position) !important;
  --tw-gradient-to: rgba(15, 143, 111, 0) var(--tw-gradient-to-position) !important;
  --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to) !important;
}

.via-brand-600 {
  --tw-gradient-to: rgba(8, 116, 91, 0) var(--tw-gradient-to-position) !important;
  --tw-gradient-stops: var(--tw-gradient-from), #08745b var(--tw-gradient-via-position), var(--tw-gradient-to) !important;
}

.to-lagoon-600 {
  --tw-gradient-to: #087287 var(--tw-gradient-to-position) !important;
}

.to-lagoon-500 {
  --tw-gradient-to: #0b8aa0 var(--tw-gradient-to-position) !important;
}

.to-accent-500 {
  --tw-gradient-to: #c47a16 var(--tw-gradient-to-position) !important;
}

html {
  background: #eef4ed;
}

body {
  font-family: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ui-ink);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.font-display {
  font-family: "Outfit", "Plus Jakarta Sans", ui-sans-serif, system-ui, sans-serif;
}

.app-shell {
  position: relative;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(244, 247, 242, 0.96) 0%, rgba(230, 242, 235, 0.9) 38%, rgba(238, 245, 246, 0.94) 68%, rgba(250, 247, 239, 0.9) 100%);
}

.dark .app-shell,
.app-shell.dark {
  background:
    linear-gradient(135deg, #101914 0%, #13261f 42%, #10252c 70%, #201d16 100%);
}

.app-shell::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(15, 143, 111, 0.065) 1px, transparent 1px),
    linear-gradient(90deg, rgba(11, 138, 160, 0.055) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0.14));
}

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

.glass {
  background: var(--ui-panel);
  border: 1px solid rgba(255, 255, 255, 0.62);
  box-shadow: var(--ui-shadow);
  backdrop-filter: blur(24px) saturate(1.22);
  -webkit-backdrop-filter: blur(24px) saturate(1.22);
}

.dark .glass {
  background: rgba(16, 25, 20, 0.78);
  border-color: rgba(255, 255, 255, 0.09);
  box-shadow: 0 24px 80px -42px rgba(0, 0, 0, 0.9);
}

.rounded-4xl {
  border-radius: 2rem;
}

.rounded-5xl {
  border-radius: 2.5rem;
}

.shadow-soft {
  box-shadow: var(--ui-shadow);
}

.shadow-soft-lg {
  box-shadow: var(--ui-shadow-strong);
}

.shadow-glow {
  box-shadow: 0 0 0 1px rgba(15, 143, 111, 0.16), 0 28px 70px -36px rgba(15, 143, 111, 0.85);
}

.nav-pill {
  isolation: isolate;
}

.nav-pill::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(15, 143, 111, 0.13), rgba(11, 138, 160, 0.1), rgba(196, 122, 22, 0.08));
  opacity: 0;
  transition: opacity 180ms ease;
}

.nav-pill:hover::before,
.nav-pill.is-active::before {
  opacity: 1;
}

.brand-mark {
  background:
    linear-gradient(145deg, #111b16 0%, #17382d 54%, #0f8f6f 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 18px 42px -28px rgba(8, 116, 91, 0.8);
}

.shimmer {
  pointer-events: none;
  background: linear-gradient(100deg, transparent 0%, rgba(255, 255, 255, 0.38) 48%, transparent 100%);
  background-size: 220% 100%;
  animation: ui-shimmer 2.8s linear infinite;
}

@keyframes ui-shimmer {
  from { background-position: 220% 0; }
  to { background-position: -220% 0; }
}

@keyframes ui-float {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(0, -10px, 0); }
}

.animate-float {
  animation: ui-float 6s ease-in-out infinite;
}

.surface-card {
  border: 1px solid var(--ui-line);
  background: var(--ui-panel);
  box-shadow: var(--ui-shadow);
  backdrop-filter: blur(18px);
}

.dark .surface-card {
  background: rgba(17, 30, 24, 0.82);
  border-color: rgba(255, 255, 255, 0.08);
}

@media screen {
  main label {
    color: #314139;
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.01em;
  }

  .dark main label {
    color: #d8e7df;
  }

  main input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
  main select,
  main textarea,
  .filter-grid input,
  .filter-grid select,
  .form-select {
    min-height: 2.75rem;
    border-radius: 1rem !important;
    border: 1px solid rgba(49, 65, 57, 0.18) !important;
    background: rgba(255, 255, 255, 0.84) !important;
    color: #18251f !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
    transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
  }

  main input:focus,
  main select:focus,
  main textarea:focus,
  .filter-grid input:focus,
  .filter-grid select:focus,
  .form-select:focus {
    border-color: rgba(15, 143, 111, 0.72) !important;
    box-shadow: 0 0 0 4px rgba(15, 143, 111, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.76) !important;
    outline: none !important;
  }

  .dark main input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
  .dark main select,
  .dark main textarea,
  .dark .filter-grid input,
  .dark .filter-grid select,
  .dark .form-select {
    background: rgba(15, 26, 21, 0.9) !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
    color: #ecf8f2 !important;
  }

  .filter-section {
    background: var(--ui-panel) !important;
    border: 1px solid var(--ui-line) !important;
    border-radius: 1.75rem !important;
    padding: 1.25rem !important;
    box-shadow: var(--ui-shadow) !important;
    backdrop-filter: blur(18px);
  }

  .btn,
  .btn-filter,
  .btn-print,
  main button[type="submit"] {
    border-radius: 0.95rem !important;
    min-height: 2.6rem;
    transition: transform 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
  }

  .btn:hover,
  .btn-filter:hover,
  .btn-print:hover,
  main button[type="submit"]:hover {
    transform: translateY(-1px);
  }

  .btn-filter {
    background: linear-gradient(135deg, #0f8f6f, #0b8aa0) !important;
    box-shadow: 0 16px 34px -24px rgba(15, 143, 111, 0.9) !important;
  }

  .btn-print {
    background: linear-gradient(135deg, #c47a16, #b45309) !important;
    box-shadow: 0 16px 34px -24px rgba(196, 122, 22, 0.9) !important;
  }

  .table-wrap,
  .overflow-x-auto:has(table) {
    border-radius: 1.35rem;
  }

  main table {
    border-collapse: separate !important;
    border-spacing: 0 !important;
  }

  main table thead th,
  .data-table thead th {
    border-color: rgba(49, 65, 57, 0.14) !important;
    background: linear-gradient(180deg, rgba(235, 245, 239, 0.98), rgba(221, 238, 229, 0.98)) !important;
    color: #26372f !important;
    font-weight: 900 !important;
    letter-spacing: 0.02em;
  }

  main table td,
  main table th,
  .data-table td,
  .data-table th {
    border-color: rgba(49, 65, 57, 0.13) !important;
  }

  main table tbody tr {
    transition: background-color 140ms ease;
  }

  main table tbody tr:hover {
    background: rgba(15, 143, 111, 0.055) !important;
  }

  .data-table tbody tr:nth-child(even) {
    background: rgba(244, 247, 242, 0.76) !important;
  }

  .total-row > td,
  .total-row > th {
    background: rgba(15, 143, 111, 0.14) !important;
    color: #10251d !important;
  }

  .subtotal-row > td,
  .subtotal-row > th {
    background: rgba(196, 122, 22, 0.14) !important;
  }

  .screen-only {
    margin: 0 0 1.25rem 0 !important;
  }

  .print-header .logo-container {
    width: auto;
    height: auto;
    margin: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
  }
}

@media (max-width: 640px) {
  .rounded-5xl {
    border-radius: 1.65rem;
  }

  .rounded-4xl {
    border-radius: 1.45rem;
  }

  main table {
    font-size: 0.82rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}

@media print {
  .no-print {
    display: none !important;
  }
}
