/* Annum brand theme — see brand_guidelines.md.
   Warm earth tones, Cinzel (display) + Spectral (body) + Source Code Pro
   (data). Palette tokens mirror the suite-wide CSS variable set. */
:root {
  --background: hsl(35 25% 96%);          /* page background #F6F4F1 */
  --foreground: hsl(25 20% 15%);          /* body text #312A24 */
  --primary: hsl(25 55% 35%);             /* CTA / links #8A5A2B */
  --primary-soft: hsl(25 55% 35% / 0.1);  /* active nav / badges */
  --primary-foreground: hsl(40 30% 98%);  /* text on primary */
  --secondary: hsl(35 15% 82%);
  --secondary-foreground: hsl(25 20% 18%);
  --muted: hsl(35 12% 88%);
  --muted-foreground: hsl(25 12% 45%);
  --accent: hsl(35 18% 88%);
  --accent-soft: hsl(35 18% 88% / 0.5);   /* row hover */
  --card: hsl(40 30% 94%);                /* card surfaces #F3EFE9 */
  --card-border: hsl(35 20% 88%);
  --border: hsl(35 15% 85%);
  --input: hsl(35 15% 70%);               /* input borders */
  --ring: hsl(25 55% 35%);
  --destructive: hsl(0 65% 40%);
  --destructive-soft: hsl(0 65% 40% / 0.08);
  --success: #10b981;                      /* emerald-500, sparingly */
  --success-soft: hsl(160 84% 39% / 0.1);
  --info: #3b82f6;                         /* blue-500 accents */
  --info-soft: hsl(217 91% 60% / 0.08);

  --font-serif: 'Cinzel', 'Cormorant Garamond', Georgia, serif;
  --font-sans: 'Spectral', 'EB Garamond', Georgia, serif;
  --font-mono: 'Source Code Pro', Menlo, monospace;
  --radius: 0.5rem;
}

* { box-sizing: border-box; }

body {
  font-family: var(--font-sans);
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  line-height: 1.625;
}

h1, h2 {
  font-family: var(--font-serif);
  font-weight: 700;
  color: var(--foreground);
  line-height: 1.25;
  letter-spacing: -0.015em;
}
h3 {
  font-family: var(--font-sans);
  font-weight: 600;
  color: var(--foreground);
  line-height: 1.25;
}
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; margin-top: 2rem; }

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Top bar — warm, light, understated (suite-consistent) */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.75rem;
  background: hsl(35 25% 96% / 0.95);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  backdrop-filter: blur(6px);
}
.topbar .brand {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 1.25rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--foreground);
}
.topbar .brand:hover { color: var(--foreground); text-decoration: none; }
.brand-product {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  color: var(--muted-foreground);
  margin-left: 0.6rem;
  vertical-align: middle;
}
.topbar-right { display: flex; align-items: center; gap: 0.35rem; flex-wrap: wrap; }
.topbar-right a {
  color: var(--muted-foreground);
  font-size: 0.92rem;
  font-weight: 500;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  transition: color 0.15s ease, background 0.15s ease;
}
.topbar-right a:hover {
  color: var(--foreground);
  background: var(--accent-soft);
  text-decoration: none;
}
.topbar .user { color: var(--muted-foreground); font-size: 0.85rem; margin: 0 0.5rem; }
.role-badge {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: capitalize;
  letter-spacing: 0.02em;
}

/* Workspace banner (super admin acting-as-company) */
.workspace-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 760px;
  margin: 1rem auto 0;
  padding: 0.5rem 1rem;
  background: var(--primary-soft);
  color: var(--primary);
  border-radius: 999px;
  font-size: 0.9rem;
}

/* Content */
.content { max-width: 760px; margin: 2.5rem auto; padding: 0 1.75rem; }
.content > p { max-width: 60ch; }
.actions { display: flex; gap: 0.75rem; margin-top: 1.5rem; flex-wrap: wrap; }

/* Flash messages */
.flashes { max-width: 760px; margin: 1.25rem auto 0; padding: 0 1.75rem; }
.flash {
  padding: 0.75rem 1.1rem;
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
  font-size: 0.92rem;
  border: 1px solid transparent;
}
.flash-error, .flash-danger { background: var(--destructive-soft); color: var(--destructive); border-color: hsl(0 65% 40% / 0.25); }
.flash-info, .flash-message { background: var(--info-soft); color: var(--info); border-color: hsl(217 91% 60% / 0.25); }
.flash-success { background: var(--success-soft); color: var(--success); border-color: hsl(160 84% 39% / 0.25); }

/* Buttons — always pill-shaped, per brand */
.btn, button[type="submit"] {
  display: inline-block;
  padding: 0.6rem 1.5rem;
  background: var(--primary);
  color: var(--primary-foreground);
  border: none;
  border-radius: 999px;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: opacity 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover, button[type="submit"]:hover {
  opacity: 0.9;
  box-shadow: 0 1px 2px hsl(25 20% 15% / 0.15);
  color: var(--primary-foreground);
  text-decoration: none;
}

/* Forms */
form { max-width: 440px; }
label { display: block; margin: 0.9rem 0 0.3rem; font-weight: 500; font-size: 0.9rem; color: var(--foreground); }
label.checkbox { display: flex; align-items: center; gap: 0.4rem; font-weight: 400; color: var(--foreground); }
input[type="text"], input[type="email"], input[type="password"], input[type="date"], select {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--input);
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  color: var(--foreground);
  background: var(--background);
}
input[type="number"] { font-family: var(--font-mono); }
input:focus, select:focus {
  outline: none;
  border-color: var(--ring);
  box-shadow: 0 0 0 2px hsl(25 55% 35% / 0.25);
}
.field-error { color: var(--destructive); font-size: 0.82rem; margin-top: 0.25rem; }

/* Tables */
.muted { color: var(--muted-foreground); }
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0 2rem;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 0.75rem;
  overflow: hidden;
}
.data-table th, .data-table td {
  text-align: left;
  padding: 0.65rem 0.9rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}
.data-table td { font-variant-numeric: tabular-nums; }
.data-table th {
  background: var(--muted);
  color: var(--muted-foreground);
  font-family: var(--font-sans);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.75rem;
}
.data-table tbody tr { transition: background 0.15s ease; }
.data-table tbody tr:hover { background: var(--accent-soft); }
.data-table tr:last-child td { border-bottom: none; }

/* Row actions in tables */
.row-actions { display: flex; gap: 0.85rem; align-items: center; }
.inline-form { display: inline; margin: 0; }
.link-button {
  background: none;
  border: none;
  color: var(--primary);
  padding: 0;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  cursor: pointer;
}
.link-button:hover { text-decoration: underline; background: none; color: var(--primary); box-shadow: none; opacity: 1; }
.link-button.danger { color: var(--destructive); }
.link-button.danger:hover { color: var(--destructive); }

/* Definition-style detail table (profile view) */
.detail-table th { width: 38%; text-transform: none; letter-spacing: normal; }

/* Report filter row */
.report-filter { display: flex; gap: 1rem; align-items: flex-end; flex-wrap: wrap; max-width: none; margin-bottom: 1rem; }
.report-filter label { margin: 0 0 0.25rem; }
.report-filter input[type="date"] { width: auto; }

/* Profile key/value editor (two columns: field name | value) */
.kv-form { max-width: 720px; }
.kv-row { display: flex; gap: 0.6rem; margin-bottom: 0.5rem; }
.kv-row input { margin: 0; }
.kv-row input:first-child { flex: 0 0 34%; }
.kv-row input:last-child { flex: 1; }
.kv-head { font-size: 0.8rem; font-weight: 600; color: var(--muted-foreground); text-transform: uppercase; letter-spacing: 0.05em; }
.kv-head span:first-child { flex: 0 0 34%; }
.kv-head span:last-child { flex: 1; }

/* Repeatable group rows */
.group-rows { margin-bottom: 0.5rem; }
.group-row { display: flex; gap: 0.5rem; margin-bottom: 0.5rem; }
.group-row input { flex: 1; }

/* Auth card — large rounded card per brand (rounded-[28px]) */
.auth-card {
  max-width: 420px;
  margin: 4rem auto;
  background: var(--card);
  padding: 2.5rem;
  border: 1px solid hsl(25 55% 35% / 0.15);
  border-radius: 28px;
  box-shadow: 0 6px 24px hsl(25 20% 15% / 0.08);
  text-align: center;
}
.auth-card h1 {
  margin-top: 0;
  margin-bottom: 0.25rem;
  font-weight: 400;
  font-size: 1.75rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
}
.auth-card .tagline {
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted-foreground);
  margin: 0 0 1.5rem;
}
.auth-card .product {
  font-size: 0.95rem;
  color: var(--muted-foreground);
  margin-bottom: 1.25rem;
}
.auth-card .btn { width: 100%; margin-top: 1.5rem; }
