/* ── Buttons ─────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 14px;
  height: 36px;
  border-radius: 7px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background var(--transition), box-shadow var(--transition), opacity var(--transition), color var(--transition), border-color var(--transition);
  font-family: var(--font);
  white-space: nowrap;
  text-decoration: none;
}

.btn svg { width: 15px; height: 15px; }

.btn-primary              { background: var(--brand); color: #fff; }
.btn-primary:hover        { background: var(--brand-light); }
.btn-secondary            { background: var(--surface); color: var(--text); border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.btn-secondary:hover      { background: var(--bg); }
.btn-ghost                { background: transparent; color: var(--text-muted); border: 1px solid transparent; }
.btn-ghost:hover          { background: var(--bg); color: var(--text); }
.btn-danger               { background: var(--danger); color: #fff; }
.btn-danger:hover         { opacity: .85; }
.btn-outline              { background: transparent; color: var(--brand); border: 1.5px solid var(--brand); }
.btn-outline:hover        { background: var(--brand); color: #fff; }

.btn-sm  { height: 30px; padding: 0 10px; font-size: 12.5px; }
.btn-lg  { height: 46px; padding: 0 24px; font-size: 15px; border-radius: 9px; }

/* ── Cards ───────────────────────────────────────────────────────────────── */

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

.card-pad    { padding: 20px; }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.card-title { font-size: 14px; font-weight: 600; color: var(--text); }
.card-body  { padding: 20px; }

/* ── Stat cards ──────────────────────────────────────────────────────────── */

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stat-label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); }
.stat-value { font-size: 28px; font-weight: 700; color: var(--text); line-height: 1; }
.stat-sub   { font-size: 12px; color: var(--text-xmuted); }

.stat-icon {
  width: 38px; height: 38px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}

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

/* ── Badges ──────────────────────────────────────────────────────────────── */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 600;
}

.badge-green  { background: var(--success-soft); color: var(--success); }
.badge-yellow { background: var(--harvest-soft); color: #9A6F1A; }
.badge-red    { background: var(--danger-soft);  color: var(--danger); }
.badge-gray   { background: var(--border-soft);  color: var(--text-muted); }
.badge-blue   { background: var(--sky-soft);     color: #2E5F8A; }
.badge-brown  { background: var(--soil-soft);    color: var(--soil); }

/* ── Tables ──────────────────────────────────────────────────────────────── */

.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; }

th {
  text-align: left;
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
  color: var(--text);
  vertical-align: middle;
}

tr:last-child td { border-bottom: none; }
tr:hover td      { background: #fafafa; }

/* ── Forms ───────────────────────────────────────────────────────────────── */

.form-group { margin-bottom: 16px; }

label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 6px;
}

input, select, textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 7px;
  font-size: 13.5px;
  font-family: var(--font);
  color: var(--text);
  background: var(--surface);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(47,93,58,.12);
}

textarea   { min-height: 90px; resize: vertical; line-height: 1.5; }
.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* ── Timeline ────────────────────────────────────────────────────────────── */

.timeline { list-style: none; }

.timeline-item {
  display: flex;
  gap: 14px;
  padding-bottom: 20px;
  position: relative;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: 15px;
  top: 28px;
  bottom: 0;
  width: 2px;
  background: var(--border);
}

.timeline-item:last-child::before { display: none; }

.timeline-dot {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--accent-soft);
  border: 2px solid var(--accent);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  z-index: 1;
}

.timeline-dot svg    { width: 14px; height: 14px; color: var(--brand); }
.timeline-content    { flex: 1; padding-top: 4px; }
.timeline-type       { font-weight: 600; font-size: 13.5px; text-transform: capitalize; }
.timeline-date       { font-size: 12px; color: var(--text-muted); }
.timeline-notes      { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

/* ── Empty states ────────────────────────────────────────────────────────── */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
  color: var(--text-muted);
}

.empty-state svg         { width: 40px; height: 40px; opacity: .3; margin-bottom: 12px; }
.empty-state-title       { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.empty-state-sub         { font-size: 13px; }

/* ── Grid helpers ────────────────────────────────────────────────────────── */

.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }

@media (max-width: 1100px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 700px)  {
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
}

/* ── Utility ─────────────────────────────────────────────────────────────── */

.divider        { height: 1px; background: var(--border); margin: 20px 0; }
.text-muted     { color: var(--text-muted); }
.text-sm        { font-size: 12.5px; }
.fw-600         { font-weight: 600; }
.mt-4           { margin-top: 4px; }
.mt-8           { margin-top: 8px; }
.mt-16          { margin-top: 16px; }
.mt-24          { margin-top: 24px; }
.flex           { display: flex; }
.items-center   { align-items: center; }
.justify-between{ justify-content: space-between; }
