/* === NaturaIQ main app styling (v0.15.0) === */

/* Reset & layout */
body {
  background: #0a0f1c;
  color: #e5e7eb;
  font: 14px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
  margin: 0;
}
.main-content {
  margin-left: 248px;
  padding: 28px 32px;
  min-height: 100vh;
}
.muted { color: #94a3b8; font-size: 12px; }
.link { color: #38bdf8; text-decoration: none; }
.link:hover { text-decoration: underline; }
.link-arrow { color: #38bdf8; font-size: 12px; text-decoration: none; }
.link-arrow:hover { text-decoration: underline; }
.r { text-align: right; }

/* === Page head (title + action buttons) === */
.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; margin-bottom: 18px; flex-wrap: wrap;
}
.page-head h1 { font-size: 1.4rem; font-weight: 700; color: #f3f4f6; }
.page-head p { margin: 4px 0 0; }
.page-head-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* === Buttons === */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 6px;
  font-weight: 500; font-size: 13px;
  text-decoration: none; border: 1px solid transparent;
  cursor: pointer; transition: all 0.15s;
}
.btn-primary { background: #22c55e; color: #fff; border-color: #22c55e; }
.btn-primary:hover { background: #16a34a; }
.btn-ghost { background: transparent; color: #cbd5e1; border-color: #334155; }
.btn-ghost:hover { background: #1e293b; color: #f3f4f6; }
.btn-warning { background: #f59e0b; color: #fff; border-color: #f59e0b; }
.btn-warning:hover { background: #d97706; }
.btn-sm { padding: 4px 8px; font-size: 12px; }

/* === KPI cards (horizontal strip) === */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px; margin-bottom: 18px;
}
.kpi-card {
  display: block; padding: 14px 16px;
  background: linear-gradient(180deg, #131c2e 0%, #0f172a 100%);
  border: 1px solid #1e293b; border-radius: 8px;
  text-decoration: none; color: inherit;
  transition: all 0.15s;
}
.kpi-card:hover { border-color: #334155; transform: translateY(-1px); }
.kpi-label { color: #94a3b8; font-size: 11px; font-weight: 600; letter-spacing: 0.5px; }
.kpi-value { color: #f3f4f6; font-size: 2rem; font-weight: 700; line-height: 1.1; margin: 4px 0 2px; }
.kpi-sub { color: #94a3b8; font-size: 12px; }

/* === Cards (sections) === */
.card {
  background: #131c2e; border: 1px solid #1e293b;
  border-radius: 8px; padding: 16px; margin-bottom: 16px;
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px; padding-bottom: 8px;
  border-bottom: 1px solid #1e293b;
}

/* === Data tables === */
.data-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
}
.data-table thead th {
  text-align: left; padding: 8px 10px; color: #94a3b8;
  font-weight: 600; font-size: 11px; letter-spacing: 0.5px;
  text-transform: uppercase;
  border-bottom: 1px solid #1e293b;
}
.data-table tbody td {
  padding: 8px 10px; border-bottom: 1px solid #1e293b;
  color: #e5e7eb;
}
.data-table tbody tr:hover { background: rgba(56, 189, 248, 0.04); }
.data-table tbody tr:last-child td { border-bottom: 0; }

/* === Pills (status badges) === */
.pill {
  display: inline-block;
  padding: 2px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 600;
  background: #1e293b; color: #cbd5e1;
  border: 1px solid #334155;
}
.pill-draft { background: #1e293b; color: #94a3b8; }
.pill-sent, .pill-quoted { background: #1e3a8a44; color: #60a5fa; border-color: #1e40af88; }
.pill-viewed { background: #164e6344; color: #22d3ee; border-color: #0e749088; }
.pill-accepted { background: #14532d44; color: #4ade80; border-color: #16653488; }
.pill-rejected, .pill-cancelled, .pill-expired { background: #7f1d1d44; color: #f87171; border-color: #991b1b88; }
.pill-converted { background: #14532d44; color: #86efac; border-color: #16653488; }
.pill-confirmed, .pill-paid { background: #14532d44; color: #4ade80; border-color: #16653488; }
.pill-in_production { background: #713f1244; color: #fbbf24; border-color: #92400e88; }
.pill-invoiced { background: #1e3a8a44; color: #93c5fd; border-color: #1e40af88; }
.pill-shipped { background: #164e6344; color: #67e8f9; border-color: #0e749088; }
.pill-delivered { background: #14532d44; color: #4ade80; border-color: #16653488; }

/* === Tabs === */
.tabs {
  display: flex; gap: 4px; margin-bottom: 12px;
  border-bottom: 1px solid #1e293b;
}
.tab {
  padding: 8px 16px; color: #94a3b8;
  text-decoration: none; border-bottom: 2px solid transparent;
  margin-bottom: -1px; transition: all 0.15s;
}
.tab:hover { color: #e5e7eb; }
.tab.active { color: #38bdf8; border-bottom-color: #38bdf8; }
.tab-count {
  display: inline-block; margin-left: 6px;
  padding: 1px 8px; border-radius: 999px;
  background: #1e293b; font-size: 11px; font-weight: 600;
}

/* === Filter bar === */
.filter-bar {
  display: flex; gap: 8px; flex-wrap: wrap;
  padding: 12px; background: #131c2e;
  border: 1px solid #1e293b; border-radius: 8px;
  margin-bottom: 12px;
}
.filter-bar select, .filter-bar input {
  padding: 6px 10px; background: #0f172a; color: #e5e7eb;
  border: 1px solid #334155; border-radius: 4px;
  font-size: 13px;
}

/* === Forms === */
.form-grid { display: flex; flex-direction: column; gap: 12px; }
.form-row {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}
.form-row label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: #94a3b8; }
.form-row label input,
.form-row label select,
.form-row label textarea {
  padding: 8px 10px; background: #0f172a; color: #e5e7eb;
  border: 1px solid #334155; border-radius: 4px;
  font-size: 13px; font-family: inherit;
}
.form-row label input:focus,
.form-row label select:focus,
.form-row label textarea:focus {
  outline: none; border-color: #38bdf8;
}

/* === Two-column grid === */
.cols-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
@media (max-width: 1000px) { .cols-2 { grid-template-columns: 1fr; } }

/* === Helpers === */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-success { color: #4ade80; }
.text-danger { color: #f87171; }
.text-warning { color: #fbbf24; }
hr { border: 0; border-top: 1px solid #1e293b; margin: 16px 0; }
