:root {
  --lb-bg: #f3f4f6;
  --lb-surface: #ffffff;
  --lb-text: #111111;
  --lb-muted: #6b7280;
  --lb-border: #ebebeb;
  --lb-black: #111111;
  --lb-lime: #d4f574;
  --lb-lime-text: #3d4f0f;
  --lb-coral: #ffb4a2;
  --lb-coral-text: #7f2d1a;
  --lb-blue-soft: #dbeafe;
  --lb-blue-text: #1d4ed8;
  --lb-radius: 1.5rem;
  --lb-radius-pill: 9999px;
  --lb-shadow: 0 4px 24px rgba(0, 0, 0, 0.04);
  --lb-shadow-sm: 0 2px 12px rgba(0, 0, 0, 0.03);
}

* { box-sizing: border-box; }

body.lb-body {
  font-family: "Inter", "Plus Jakarta Sans", system-ui, sans-serif;
  color: var(--lb-text);
  background: var(--lb-bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ——— Top navigation (Ecomora-style) ——— */
.lb-shell {
  background: var(--lb-surface);
  border-bottom: 1px solid var(--lb-border);
  position: sticky;
  top: 0;
  z-index: 50;
}

.lb-topnav {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 4.25rem;
  display: flex;
  align-items: center;
  gap: 2rem;
}

.lb-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: -0.03em;
  color: var(--lb-black);
  text-decoration: none;
  flex-shrink: 0;
}

.lb-logo-icon {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--lb-lime);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
}

.lb-topnav-menu {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  flex: 1;
  min-width: 0;
}

.lb-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--lb-muted);
  text-decoration: none;
  padding-bottom: 0.125rem;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
}

.lb-nav-link:hover { color: var(--lb-black); }

.lb-nav-link.is-active {
  color: var(--lb-black);
  font-weight: 600;
  border-bottom-color: var(--lb-black);
}

.lb-topnav-right {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
}

.lb-profile-chip {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  text-decoration: none;
  color: inherit;
  padding: 0.25rem 0.5rem 0.25rem 0.25rem;
  border-radius: var(--lb-radius-pill);
  transition: background 0.15s;
}

.lb-profile-chip:hover { background: #f9fafb; }

.lb-profile-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--lb-black);
  line-height: 1.2;
}

.lb-profile-chevron {
  color: #9ca3af;
  font-size: 0.625rem;
}

.lb-btn-logout {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--lb-muted);
  text-decoration: none;
  padding: 0.5rem 1rem;
  border: 1px solid var(--lb-border);
  border-radius: var(--lb-radius-pill);
  background: var(--lb-surface);
  transition: border-color 0.15s, color 0.15s;
}

.lb-btn-logout:hover {
  color: var(--lb-black);
  border-color: #d1d5db;
}

.lb-avatar {
  border-radius: 50%;
  overflow: hidden;
  background: #e5e7eb;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lb-main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.75rem 1.5rem 3rem;
  width: 100%;
}

.lb-main.lb-main--wide {
  max-width: 96rem;
}

/* ——— Page header ——— */
.lb-page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.lb-page-title {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--lb-black);
  line-height: 1.1;
}

.lb-page-lead {
  color: var(--lb-muted);
  font-size: 0.875rem;
  margin-top: 0.35rem;
}

/* ——— Cards ——— */
.lb-card {
  background: var(--lb-surface);
  border: 1px solid var(--lb-border);
  border-radius: var(--lb-radius);
  box-shadow: var(--lb-shadow-sm);
}

/* ——— Buttons ——— */
.lb-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding: 0.625rem 1.375rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #fff;
  background: var(--lb-black);
  border: none;
  border-radius: var(--lb-radius-pill);
  cursor: pointer;
  transition: opacity 0.15s, transform 0.15s;
  white-space: nowrap;
}

.lb-btn-primary:hover {
  opacity: 0.88;
  transform: translateY(-1px);
}

.lb-btn-primary:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
}

.lb-btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--lb-black);
  background: var(--lb-surface);
  border: 1px solid var(--lb-border);
  border-radius: var(--lb-radius-pill);
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s;
}

.lb-btn-outline:hover {
  border-color: #d1d5db;
  background: #fafafa;
}

.lb-btn-danger {
  display: inline-flex;
  align-items: center;
  padding: 0.625rem 1.375rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #fff;
  background: #ef4444;
  border: none;
  border-radius: var(--lb-radius-pill);
  cursor: pointer;
  transition: opacity 0.15s;
}

.lb-btn-danger:hover { opacity: 0.9; }

.lb-btn-attach {
  padding: 0.35rem 0.875rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--lb-lime-text);
  background: var(--lb-lime);
  border: none;
  border-radius: var(--lb-radius-pill);
  cursor: pointer;
  transition: filter 0.15s;
}

.lb-btn-attach:hover { filter: brightness(0.96); }

/* ——— Inputs ——— */
.lb-input,
.lb-select,
.lb-textarea {
  width: 100%;
  padding: 0.75rem 1.125rem;
  font-size: 0.875rem;
  font-family: inherit;
  color: var(--lb-text);
  background: #fafafa;
  border: 1px solid var(--lb-border);
  border-radius: var(--lb-radius-pill);
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.lb-select { border-radius: var(--lb-radius); }

.lb-textarea {
  border-radius: 1rem;
  resize: vertical;
}

.lb-input:focus,
.lb-select:focus,
.lb-textarea:focus {
  outline: none;
  background: #fff;
  border-color: #d1d5db;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.04);
}

.lb-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--lb-muted);
  margin-bottom: 0.375rem;
}

.lb-hint {
  font-size: 0.75rem;
  color: var(--lb-muted);
}

/* ——— Tables ——— */
.lb-table-wrap {
  overflow: hidden;
  border-radius: var(--lb-radius);
}

.lb-table {
  width: 100%;
  font-size: 0.875rem;
  border-collapse: collapse;
}

.lb-table thead tr {
  border-bottom: 1px solid var(--lb-border);
}

.lb-table th {
  padding: 1rem 1.25rem;
  font-weight: 600;
  font-size: 0.8125rem;
  color: var(--lb-muted);
  text-align: left;
  white-space: nowrap;
}

.lb-table td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #f5f5f5;
  vertical-align: middle;
}

.lb-table tbody tr:hover { background: #fafafa; }

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

.lb-link {
  color: var(--lb-black);
  font-weight: 600;
  text-decoration: none;
}

.lb-link:hover { text-decoration: underline; }

/* A <button> styled to look exactly like .lb-link, for state-changing actions that must POST
   (e.g. the projects-board "open" action) — no background/border, inherits the link color. */
.lb-link-button {
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  color: var(--lb-black);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.lb-link-button:hover { text-decoration: underline; }

.lb-back {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--lb-muted);
  text-decoration: none;
  margin-bottom: 0.75rem;
}

.lb-back:hover { color: var(--lb-black); }

/* ——— Badges (Ecomora pills) ——— */
.lb-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.625rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--lb-radius-pill);
}

.lb-badge--lime {
  background: var(--lb-lime);
  color: var(--lb-lime-text);
}

.lb-badge--coral {
  background: var(--lb-coral);
  color: var(--lb-coral-text);
}

.lb-badge--blue {
  background: var(--lb-blue-soft);
  color: var(--lb-blue-text);
}

.lb-badge--muted {
  background: #f3f4f6;
  color: var(--lb-muted);
}

.lb-badge--ok {
  background: #dcfce7;
  color: #166534;
}

.lb-badge--warn {
  background: #fef3c7;
  color: #92400e;
}

/* legacy aliases */
.lb-badge--ok { background: #dcfce7; color: #166534; }

/* ——— Alerts ——— */
.lb-alert {
  padding: 1rem 1.25rem;
  border-radius: var(--lb-radius);
  font-size: 0.875rem;
}

.lb-alert--warn {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
}

.lb-alert--danger {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

/* ——— Project section tabs ——— */
.lb-subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.75rem;
  padding: 0.5rem;
  background: var(--lb-surface);
  border: 1px solid var(--lb-border);
  border-radius: var(--lb-radius-pill);
  box-shadow: var(--lb-shadow-sm);
  width: fit-content;
  max-width: 100%;
}

.lb-subnav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.625rem 1.375rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--lb-black);
  text-decoration: none;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: var(--lb-radius-pill);
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.12s;
  white-space: nowrap;
}

.lb-subnav a:hover {
  background: #fff;
  border-color: #d1d5db;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.lb-subnav a.is-active {
  color: #fff;
  background: var(--lb-black);
  border-color: var(--lb-black);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}

.lb-usage-row {
  margin-bottom: 0.875rem;
}

.lb-usage-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.8125rem;
  margin-bottom: 0.35rem;
}

.lb-usage-bar {
  height: 0.5rem;
  background: #f3f4f6;
  border-radius: var(--lb-radius-pill);
  overflow: hidden;
}

.lb-usage-bar span {
  display: block;
  height: 100%;
  background: var(--lb-lime);
  border-radius: var(--lb-radius-pill);
  transition: width 0.2s;
}

.lb-usage-bar span.is-over {
  background: var(--lb-coral);
}

.lb-pricing-table {
  width: 100%;
  font-size: 0.8125rem;
  border-collapse: collapse;
}

.lb-pricing-table th,
.lb-pricing-table td {
  padding: 0.625rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid #f5f5f5;
}

.lb-pricing-table th {
  font-weight: 600;
  color: var(--lb-muted);
  font-size: 0.75rem;
}

.lb-section-title {
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--lb-black);
  margin-bottom: 0.75rem;
}

/* ——— Login ——— */
.lb-login-bg {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: var(--lb-bg);
}

.lb-login-card {
  width: 100%;
  max-width: 28rem;
  background: var(--lb-surface);
  border-radius: var(--lb-radius);
  padding: 2.5rem;
  box-shadow: var(--lb-shadow);
  border: 1px solid var(--lb-border);
}

.lb-login-demo {
  width: 100%;
  max-width: 28rem;
  margin-top: 1rem;
  padding: 1.25rem;
  background: var(--lb-surface);
  border: 1px solid var(--lb-border);
  border-radius: var(--lb-radius);
  color: var(--lb-muted);
  font-size: 0.8125rem;
  box-shadow: var(--lb-shadow-sm);
}
