:root {
  --app-bg: #f6f7f4;
  --app-surface: rgba(255, 255, 255, 0.88);
  --app-surface-strong: #ffffff;
  --app-border: #e3e8df;
  --app-text: #17201a;
  --app-muted: #687268;
  --app-primary: #176b4d;
  --app-primary-dark: #0f5138;
  --app-primary-soft: #e4f4ec;
  --app-accent: #d6f36d;
  --app-shadow: 0 24px 60px rgba(23, 32, 26, 0.08);
  --app-radius: 1.25rem;
}

html {
  min-height: 100%;
  font-size: 15px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--app-text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(214, 243, 109, 0.32), transparent 32rem),
    radial-gradient(circle at top right, rgba(23, 107, 77, 0.12), transparent 28rem),
    var(--app-bg);
}

a {
  color: var(--app-primary);
}

.app-navbar {
  position: sticky;
  top: 0;
  z-index: 1030;
  border-bottom: 1px solid rgba(227, 232, 223, 0.85);
  background: rgba(246, 247, 244, 0.84);
  backdrop-filter: blur(18px);
}

.navbar-brand {
  color: var(--app-text);
  font-weight: 800;
  letter-spacing: -0.04em;
}

.brand-mark {
  display: inline-grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  border-radius: 999px;
  color: #102017;
  background: linear-gradient(135deg, var(--app-accent), #8ee8b6);
  box-shadow: 0 10px 28px rgba(23, 107, 77, 0.18);
}

.nav-link {
  color: #3b463d;
  border-radius: 999px;
  font-weight: 600;
  padding-inline: 0.9rem !important;
}

.nav-link:hover,
.nav-link:focus {
  color: var(--app-primary-dark);
  background: rgba(23, 107, 77, 0.08);
}

.dropdown-menu {
  border: 1px solid var(--app-border);
  border-radius: 1rem;
  box-shadow: var(--app-shadow);
}

.dropdown-item {
  border-radius: 0.7rem;
  margin: 0.15rem 0.4rem;
  width: auto;
  font-weight: 500;
}

.app-container {
  max-width: 1120px;
  padding-top: clamp(1.25rem, 2vw, 2.5rem);
  padding-bottom: 4rem;
}

.auth-shell {
  display: grid;
  min-height: calc(100vh - 14rem);
  place-items: center;
  padding-block: clamp(1.5rem, 6vw, 4rem);
}

.auth-card {
  width: min(100%, 28rem);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(228, 244, 236, 0.78)),
    var(--app-surface-strong);
  box-shadow: var(--app-shadow);
  padding: clamp(1.4rem, 5vw, 2.25rem);
}

.auth-mark {
  display: inline-grid;
  width: 3rem;
  height: 3rem;
  margin-bottom: 1.25rem;
  place-items: center;
  border-radius: 1rem;
  color: #102017;
  background: linear-gradient(135deg, var(--app-accent), #8ee8b6);
  box-shadow: 0 14px 32px rgba(23, 107, 77, 0.18);
  font-size: 1.5rem;
}

.auth-title {
  margin: 0;
  font-size: clamp(2rem, 6vw, 2.75rem);
  line-height: 1;
}

.auth-subtitle {
  margin: 0.75rem 0 1.75rem;
  color: var(--app-muted);
  font-size: 1rem;
}

.auth-form {
  margin-top: 1.5rem;
}

.app-footer {
  padding: 2rem 0 2.5rem;
  color: var(--app-muted);
  font-size: 0.9rem;
}

h1,
h2,
h3 {
  letter-spacing: -0.05em;
}

h1 {
  font-weight: 800;
}

h2 {
  font-size: 1.25rem;
  font-weight: 750;
}

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.eyebrow {
  color: var(--app-primary);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.page-title {
  margin: 0;
}

.page-subtitle {
  max-width: 44rem;
  margin: 0.35rem 0 0;
  color: var(--app-muted);
}

.hero-card,
.app-card,
.empty-state {
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  background: var(--app-surface);
  box-shadow: var(--app-shadow);
}

.hero-card {
  overflow: hidden;
  padding: clamp(1.35rem, 4vw, 2.5rem);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(228, 244, 236, 0.84)),
    var(--app-surface-strong);
}

.app-card {
  padding: 1.15rem;
}

.metric-card {
  min-height: 8.5rem;
  border: 1px solid var(--app-border);
  border-radius: 1rem;
  background: var(--app-surface-strong);
  padding: 1rem;
}

.metric-label {
  color: var(--app-muted);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.metric-value {
  margin-top: 0.55rem;
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.08em;
}

.metric-hint {
  margin-top: 0.45rem;
  color: var(--app-muted);
  font-size: 0.9rem;
}

.setup-step-number {
  display: inline-grid;
  flex: 0 0 2.25rem;
  width: 2.25rem;
  height: 2.25rem;
  place-items: center;
  border-radius: 999px;
  color: #102017;
  background: linear-gradient(135deg, var(--app-accent), #8ee8b6);
  font-weight: 800;
}

.btn {
  border-radius: 999px;
  font-weight: 700;
}

.btn-primary {
  border-color: var(--app-primary);
  background: var(--app-primary);
}

.btn-primary:hover,
.btn-primary:focus {
  border-color: var(--app-primary-dark);
  background: var(--app-primary-dark);
}

.btn-outline-primary {
  border-color: rgba(23, 107, 77, 0.35);
  color: var(--app-primary);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
  border-color: var(--app-primary);
  background: var(--app-primary);
}

.form-control,
.form-select {
  border-color: var(--app-border);
  border-radius: 0.9rem;
  padding: 0.72rem 0.9rem;
}

.form-control:focus,
.form-select:focus,
.form-check-input:focus,
.btn:focus,
.btn:active:focus,
.nav-link:focus {
  border-color: rgba(23, 107, 77, 0.5);
  box-shadow: 0 0 0 0.25rem rgba(23, 107, 77, 0.14);
}

.form-label {
  color: #354239;
  font-weight: 700;
}

.form-text {
  color: var(--app-muted);
}

.quick-field .form-control {
  font-size: 1.25rem;
  font-weight: 750;
}

.list-group {
  gap: 0.65rem;
}

.list-group-item {
  border: 1px solid var(--app-border) !important;
  border-radius: 1rem !important;
  background: var(--app-surface-strong);
}

.list-group-item-action:hover {
  transform: translateY(-1px);
  background: #fbfdf9;
  box-shadow: 0 14px 34px rgba(23, 32, 26, 0.07);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 999px;
  padding: 0.3rem 0.65rem;
  color: var(--app-primary-dark);
  background: var(--app-primary-soft);
  font-size: 0.78rem;
  font-weight: 800;
}

.table-card {
  overflow: hidden;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  background: var(--app-surface-strong);
  box-shadow: var(--app-shadow);
}

.table {
  margin-bottom: 0;
}

.table thead th {
  color: var(--app-muted);
  background: #f8faf6;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.table > :not(caption) > * > * {
  padding: 0.9rem 1rem;
}

.empty-state {
  padding: 2.5rem 1.5rem;
  text-align: center;
}

.empty-icon {
  display: inline-grid;
  width: 3rem;
  height: 3rem;
  margin-bottom: 1rem;
  place-items: center;
  border-radius: 999px;
  color: var(--app-primary);
  background: var(--app-primary-soft);
  font-size: 1.35rem;
}

.soft-note {
  border: 1px solid #d9eadf;
  border-radius: 1rem;
  color: #294938;
  background: #eef8f1;
  padding: 1rem;
}

.danger-zone {
  border: 1px solid #f0d0d0;
  border-radius: var(--app-radius);
  background: #fff8f8;
  padding: 1rem;
}

@media (max-width: 767.98px) {
  .page-header {
    align-items: stretch;
    flex-direction: column;
  }

  .app-card,
  .hero-card {
    border-radius: 1rem;
  }
}
