/* DESAA app look: South & East brand (from "South East Branding" guideline).
   Primary colours: Brand Red #9B302D, Cream #EDE3C6, Olive #584E2B.
   Secondary colours: Marigold #F8AD2A, Burnt Orange #CD5E2E.
   Type: Oswald (the guide's heavy condensed heading face) for headings, DM Sans (the guide's body face) for text.
   Files in this folder that go with it: logo.png (the South & East wordmark, cream on red), pattern.jpg (the
   brand's hand-drawn ingredient illustrations, used behind the sign-in box).
   The shared index.html is untouched: everything DESAA-specific lives here. */
@import url("https://fonts.googleapis.com/css2?family=Oswald:wght@500;600;700&family=DM+Sans:opsz,wght@9..40,400;9..40,500;9..40,600;9..40,700&display=swap");

:root {
  /* Surfaces: warm cream page, near-white cards */
  --bg: #f6f0e1;
  --card: #fffdf8;
  --hover: #faf5ea;
  --line: #e8dfc8;
  --line-strong: #d6c9a8;

  /* Text: dark olive-brown, softened olive for secondary text */
  --ink: #2b2614;
  --muted: #6e6650;

  /* Brand red as the action colour */
  --accent: #9b302d;
  --accent-hover: #7a2522;
  --accent-ink: #fffaf0;
  --accent-soft: #f6e5dc;
  --link: #9b302d;

  /* Header: the brand red band */
  --header-bg: #9b302d;
  --header-line: #84282a;

  /* Messages, tinted to the palette */
  --info-bg: #efe9d6; --info-ink: #4a4123;                    /* olive */
  --warn: #8a5300; --warn-bg: #fdefd0; --warn-ink: #6e4200;   /* marigold */
  --bad: #b02a1f; --bad-bg: #f9e2dc; --bad-ink: #85201a;
  --ok: #4d6a22; --ok-bg: #ebf0d9; --ok-ink: #3a5118;

  /* Type */
  --font: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Oswald", "DM Sans", system-ui, sans-serif;

  /* Charts: the brand palette */
  --chart-1: #9b302d;  /* Brand Red */
  --chart-2: #f8ad2a;  /* Marigold */
  --chart-3: #584e2b;  /* Olive */
  --chart-4: #cd5e2e;  /* Burnt Orange */
  --chart-5: #c4b58a;  /* deep Cream */
  --chart-other: #e3d9bd;
  --chart-noncogs: #d6cbad;
  --chart-today: #584e2b;

  --radius: 12px; --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(88, 78, 43, .06), 0 2px 6px rgba(88, 78, 43, .05);
  --shadow-lg: 0 12px 32px rgba(60, 30, 20, .18);
}

body { font-size: 15px; }

/* ---- Header: red band, cream logo + tabs ---- */
header { border-bottom: 0; }
header h1 { color: #ede3c6; }
header h1 span { font: 600 18px/1 var(--font-display); text-transform: uppercase; letter-spacing: .04em; color: #ede3c6; }
.brand-logo { height: 46px; border-radius: 4px; }
#who { color: rgba(237, 227, 198, .78); }
#who button.link, #who a { color: #ede3c6; }
#companyBox select { background-color: #ede3c6; color: #4a1714; border-color: transparent; }
#companyBox select:focus { box-shadow: 0 0 0 3px rgba(248, 173, 42, .55); }
nav button, nav .nav-link { color: rgba(237, 227, 198, .78); font-weight: 500; }
nav button:hover, nav .nav-link:hover { color: #fffaf0; }
nav button.active { color: #fffaf0; font-weight: 700; }
nav button.active::after { background: #f8ad2a; height: 4px; }
nav button:focus-visible { outline: 2px solid #f8ad2a; outline-offset: -2px; border-radius: 6px; }

/* No app name next to the logo: the logo is the name */
header h1 > span:last-child { display: none; }

/* Wide screens: one row, logo left, page tabs centred, company + account right (like a shop's top bar) */
@media (min-width: 1100px) {
  /* three columns of which the outer two are equal, so the tabs sit in the true centre */
  header { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 24px; row-gap: 3px; padding: 0 24px; min-height: 68px; }
  header h1 { grid-column: 1; grid-row: 1 / 3; margin: 0; align-self: center; }
  nav { grid-column: 2; grid-row: 1 / 3; margin: 0; justify-content: center; align-self: stretch; overflow: visible; }
  nav > button, nav .nav-top, nav > .nav-link { padding-top: 24px; padding-bottom: 22px; }
  #companyBox { grid-column: 3; grid-row: 1; margin: 0; justify-self: end; align-self: end; }
  #who { grid-column: 3; grid-row: 2; margin: 0; justify-self: end; align-self: start; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 11.5px; }
  #companyBox[hidden] + #who { grid-row: 1 / 3; align-self: center; }
}

/* Dropdown menu (Invoice Automation) */
.nav-menu { background: #fffdf8; border-color: var(--line); }
.nav-menu button { color: var(--ink); }
.nav-menu button:hover { background: var(--accent-soft); color: var(--accent); }
.nav-menu button.active { color: var(--accent); background: var(--accent-soft); }
.nav-menu button.active::after { display: none; }
.nav-top .caret { opacity: .8; }

/* ---- Headings in the brand's condensed caps ---- */
.card h2 { font: 600 17px/1.25 var(--font-display); text-transform: uppercase; letter-spacing: .03em; color: var(--accent); }
.drop strong { font-weight: 600; text-transform: uppercase; letter-spacing: .03em; color: var(--accent); }
.an-title { font-weight: 700; text-transform: uppercase; letter-spacing: .01em; font-size: 30px; color: var(--accent); }
.an h3 { font-weight: 600; text-transform: uppercase; letter-spacing: .03em; font-size: 16px; }
.an-value { font-weight: 600; letter-spacing: 0; }
.an-split-hero .an-value { font-weight: 600; }
.o-totals b { font-weight: 600; }
th, .sort-th { letter-spacing: .07em; }

/* ---- Buttons: confident red, cream text ---- */
button.primary, a.btn.primary { letter-spacing: .01em; }
.filters button.active { background: var(--accent); border-color: var(--accent); }

/* ---- Bits of the Analytics page that had fixed white/grey ---- */
.seg button[aria-pressed="true"] { background: var(--card); color: var(--accent); }
.an-ghost:hover { border-color: var(--line-strong); }
.an-tip { background: var(--card); }
.an-table tbody tr:hover td { background: var(--hover); }
.an-table tfoot td { border-top-color: var(--accent); }

/* Chart greys are drawn with fixed cool greys; warm them to the cream palette */
.an-chart [fill="#e4e7ec"], .an-chart [fill="#f7f8fa"] { fill: #ebe2c9; }
.an-chart [fill="#f7f8fa"] { fill: #f8f2e4; }
.an-chart [stroke="#eef0f3"], .an-chart [stroke="#e3e4de"] { stroke: #ece4cf; }
.an-chart [stroke="#d5d8dd"], .an-chart [stroke="#c5c7bf"] { stroke: #d2c5a2; }
.an-key i[style*="#e4e7ec"] { background: #ebe2c9 !important; }

/* ---- Toast in olive ---- */
.toast { background: #3b341c; color: #fffaf0; }

/* ---- Sign-in: brand illustration wall, cream card, no top bar ---- */
body:has(.login) { background: #9b302d url("pattern.jpg") center / cover no-repeat fixed; min-height: 100vh; }
body:has(.login) header { display: none; }
.login { background: #f6f0e1; border: 0; box-shadow: 0 18px 50px rgba(40, 10, 8, .35); margin-top: 12vh; }
.login-logo { height: 104px; border-radius: 6px; }
.login h2 { color: var(--accent); font-size: 22px; }
@media (max-width: 520px) { .login { margin: 8vh 4px 0; } .login-logo { height: 88px; } }

@media (max-width: 760px) {
  .brand-logo { height: 38px; }
  header h1 span { font-size: 16px; }
  .an-title { font-size: 24px; }
}
