/* ============================================================
   ENGAGING BRANDS — Invoicing Suite
   Design System  ·  brand-accurate, production-grade
   ============================================================ */

/* ---------- Design tokens ---------- */
:root {
  /* Brand */
  --brand:        #F26A21;
  --brand-bright: #FB7E38;
  --brand-deep:   #E2560F;
  --brand-tint:   #FBE4D3;
  --brand-wash:   #FCF1E8;
  --gold:         #F4A623;

  /* Neutrals */
  --ink:      #171512;
  --ink-soft: #5A5449;
  --ink-mute: #8C8578;
  --charcoal: #0E1116;
  --charcoal-2:#171B21;
  --canvas:   #F5F0E9;
  --surface:  #FFFFFF;
  --surface-2:#FBF8F3;
  --line:     #E7E0D6;
  --line-2:   #EFEAE1;

  /* Status */
  --green:   #1E9E62;
  --green-bg:#E4F5EC;
  --red:     #D0453B;
  --red-bg:  #FBE7E5;
  --blue:    #2C6ECB;
  --blue-bg: #E6EEFA;
  --amber:   #C98A16;
  --amber-bg:#FBF0D6;
  --slate:   #6B7280;
  --slate-bg:#EEF0F2;

  /* Typography */
  --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Space Grotesk', 'Inter', sans-serif;

  /* Radius */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-xl: 26px;
  --r-pill: 999px;

  /* Shadow */
  --sh-xs: 0 1px 2px rgba(23,21,18,.06);
  --sh-sm: 0 2px 8px rgba(23,21,18,.06);
  --sh-md: 0 8px 24px rgba(23,21,18,.08);
  --sh-lg: 0 18px 48px rgba(23,21,18,.12);
  --sh-brand: 0 10px 26px rgba(242,106,33,.32);

  --maxw: 1280px;
}

/* ---------- Reset / base ---------- */
*,*::before,*::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font-ui);
  color: var(--ink);
  background: var(--canvas);
  line-height: 1.55;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }
a { color: inherit; text-decoration: none; }
h1,h2,h3,h4 { font-family: var(--font-display); font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
::selection { background: var(--brand-tint); color: var(--brand-deep); }

/* ---------- Reusable atoms ---------- */
.eyebrow {
  font-size: 11px; font-weight: 700; letter-spacing: .16em;
  text-transform: uppercase; color: var(--brand); display: inline-flex;
  align-items: center; gap: 8px;
}
.eyebrow::before {
  content: ""; width: 22px; height: 2px; background: var(--brand); border-radius: 2px;
}
.muted { color: var(--ink-mute); }
.soft { color: var(--ink-soft); }

/* Brand logo lockup (text fallback) */
.brand-lockup { display: inline-flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 9px; flex: none;
  background: linear-gradient(135deg, var(--brand-bright), var(--brand-deep));
  box-shadow: var(--sh-brand);
  display: grid; place-items: center; color: #fff; font-family: var(--font-display);
  font-weight: 700; font-size: 15px; letter-spacing: -.03em;
}
.brand-word { font-family: var(--font-display); font-weight: 700; font-size: 18px; letter-spacing: -.02em; }
.brand-word b { color: var(--brand); }
.brand-word span { color: var(--ink); }
/* Light chip so an uploaded logo stays visible on dark surfaces */
.logo-chip { display: inline-flex; align-items: center; background: #fff; border-radius: 10px; padding: 6px 12px; box-shadow: var(--sh-xs); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border-radius: var(--r-pill); font-weight: 600; font-size: 14px;
  border: 1px solid transparent; transition: .18s ease; white-space: nowrap; line-height: 1;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: #fff; box-shadow: var(--sh-brand); }
.btn-primary:hover { background: var(--brand-deep); }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line); box-shadow: var(--sh-xs); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand-deep); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: #000; }
.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn-lg { padding: 14px 26px; font-size: 15px; }
.btn-block { width: 100%; }
.btn-icon { padding: 9px; width: 38px; height: 38px; }

/* ---------- Forms ---------- */
.field { display: block; margin-bottom: 16px; }
.label {
  display: block; font-size: 11px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--ink-soft); margin-bottom: 7px;
}
.label .req { color: var(--brand); }
.label .opt { color: var(--ink-mute); font-weight: 600; text-transform: none; letter-spacing: 0; }
.input, .select, .textarea {
  width: 100%; padding: 12px 14px; background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--r-md); transition: .16s ease;
  font-size: 14px;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(242,106,33,.14);
}
.input::placeholder { color: var(--ink-mute); }
.textarea { min-height: 92px; resize: vertical; }
.input-group { position: relative; }
.input-group .prefix {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--ink-mute); font-weight: 600; pointer-events: none;
}
.input-group .prefix ~ .input { padding-left: 30px; }

/* ---------- Cards ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line-2);
  border-radius: var(--r-lg); box-shadow: var(--sh-sm);
}
.card-pad { padding: 22px; }
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px; border-bottom: 1px solid var(--line-2);
}
.card-head h3 { font-size: 16px; }

/* ---------- Badges / pills ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px;
  border-radius: var(--r-pill); font-size: 12px; font-weight: 600; line-height: 1.4;
}
.badge::before { content:""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .9; }
.badge-green { background: var(--green-bg); color: var(--green); }
.badge-red   { background: var(--red-bg);   color: var(--red); }
.badge-blue  { background: var(--blue-bg);  color: var(--blue); }
.badge-amber { background: var(--amber-bg); color: var(--amber); }
.badge-slate { background: var(--slate-bg); color: var(--slate); }
.badge-brand { background: var(--brand-wash); color: var(--brand-deep); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th {
  text-align: left; font-size: 11px; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--ink-mute); padding: 12px 16px;
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.data td { padding: 14px 16px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
table.data tbody tr:last-child td, table.data tr:last-child td { border-bottom: none; }
table.data tbody tr { transition: background .12s; }
table.data tbody tr:hover { background: var(--surface-2); }
.num { font-variant-numeric: tabular-nums; text-align: right; }

/* ---------- Utilities ---------- */
.row { display: flex; gap: 16px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.grid { display: grid; gap: 18px; }
.stack { display: flex; flex-direction: column; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px;
  border-radius: var(--r-pill); background: var(--surface); border: 1px solid var(--line);
  font-size: 13px; font-weight: 500;
}
.divider { height: 1px; background: var(--line-2); border: none; margin: 18px 0; }
.avatar {
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  background: var(--brand-wash); color: var(--brand-deep); font-weight: 700; font-size: 14px; flex: none;
}
.grid-bg {
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 46px 46px;
  opacity: .5;
}
.scroll { scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
