/* ANS Growth Advisors — design system
 * Brand: deep navy + signal blue + insight blue.
 * Confident, modern, B2B finance feel. Generous whitespace, restrained type.
 */

:root {
  /* Brand colors (from logo asset pack) */
  --brand-navy: #061A4A;
  --brand-blue: #1463FF;
  --brand-sky: #5DB7FF;
  --brand-gray: #E8EEF6;

  /* Semantic mappings */
  --bg: #ffffff;
  --bg-soft: #F8FAFC;
  --bg-elevated: #ffffff;
  --ink: #061A4A;           /* deep navy for primary text */
  --ink-soft: #3a4a6b;
  --ink-muted: #8a93a8;
  --rule: #E8EEF6;
  --accent: #1463FF;        /* signal blue — primary actions */
  --accent-hover: #0d4cd8;
  --accent-soft: #5DB7FF;   /* insight blue — secondary highlights */
  --success: #14B8A6;       /* teal for positive metrics */
  --error: #B04848;
  --warning: #9C7C2E;
  --shadow: 0 1px 2px rgba(6, 26, 74, 0.04), 0 4px 12px rgba(6, 26, 74, 0.06);
  --radius: 8px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--ink); }
a:hover { color: var(--accent); }

h1, h2, h3 {
  font-weight: 500;
  letter-spacing: -0.01em;
  margin: 0 0 0.4em 0;
}
h1 { font-size: 28px; }
h2 { font-size: 20px; }
h3 { font-size: 16px; color: var(--ink-soft); }

p { margin: 0 0 1em 0; color: var(--ink-soft); }
p.muted { color: var(--ink-muted); font-size: 14px; }

.container {
  max-width: 640px;
  margin: 0 auto;
  padding: 56px 24px;
}
.container-wide { max-width: 880px; }

/* Header */
.app-header {
  border-bottom: 1px solid var(--rule);
  background: var(--bg);
  padding: 14px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.app-header .brand {
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.01em;
}
.app-header .brand-sub {
  color: var(--ink-muted);
  font-weight: 400;
  margin-left: 8px;
}
.app-header .user-info {
  color: var(--ink-soft);
  font-size: 14px;
}
.app-header .user-info a { margin-left: 16px; }

/* Card */
.card {
  background: var(--bg-elevated);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 32px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}

/* Forms */
form { margin: 0; }

label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-soft);
  margin-bottom: 6px;
  letter-spacing: 0.01em;
}

input[type="text"], input[type="email"], input[type="date"], input[type="number"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--bg-elevated);
  color: var(--ink);
  font-family: inherit;
  font-size: 15px;
  transition: border-color 0.15s;
}
input[type="text"]:focus, input[type="email"]:focus,
input[type="date"]:focus, input[type="number"]:focus {
  outline: none;
  border-color: var(--ink);
}

input[type="file"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px dashed var(--rule);
  border-radius: 6px;
  background: var(--bg);
  color: var(--ink-soft);
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
}
input[type="file"]:hover { border-color: var(--ink-muted); }

.field { margin-bottom: 18px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  color: var(--ink-soft);
  font-size: 14px;
}
.checkbox-row input { width: auto; }

/* Buttons */
button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border: 1px solid var(--ink);
  border-radius: 6px;
  background: var(--ink);
  color: var(--bg-elevated);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  text-decoration: none;
}
button:hover, .btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
button:disabled, .btn:disabled {
  opacity: 0.5; cursor: not-allowed;
}
.btn-secondary {
  background: transparent;
  color: var(--ink);
}
.btn-secondary:hover {
  background: var(--ink);
  color: var(--bg-elevated);
  border-color: var(--ink);
}

/* Status / alerts */
.alert {
  padding: 12px 16px;
  border-radius: 6px;
  margin-bottom: 18px;
  font-size: 14px;
}
.alert-success { background: #e8f7f5; color: var(--success); }
.alert-error   { background: #faecec; color: var(--error); }
.alert-warning { background: #fdf3e3; color: #9a6b00; }
.alert-info    { background: var(--brand-gray); color: var(--ink-soft); }

.spinner {
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid var(--rule);
  border-top-color: var(--ink);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
  margin-right: 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Job list */
.job-list { border-top: 1px solid var(--rule); }
.job-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 16px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--rule);
  font-size: 14px;
}
.job-row .job-period { font-weight: 500; }
.job-row .job-meta { color: var(--ink-muted); font-size: 13px; }
.job-row .status {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 500;
}
.status-queued    { color: var(--ink-muted); }
.status-running   { color: var(--warning); }
.status-completed { color: var(--success); }
.status-failed    { color: var(--error); }

.job-actions a {
  font-size: 13px;
  margin-left: 12px;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.job-actions a:hover { border-bottom-color: var(--accent); }

/* Subtle */
.divider {
  height: 1px;
  background: var(--rule);
  margin: 32px 0;
}

.help-text {
  font-size: 13px;
  color: var(--ink-muted);
  margin-top: 4px;
  line-height: 1.5;
}

/* Responsive */
@media (max-width: 600px) {
  .container { padding: 32px 16px; }
  .card { padding: 20px; }
  .field-row { grid-template-columns: 1fr; }
  .app-header { padding: 14px 16px; }
}

/* Audit log card */
.audit-link {
  font-size: 13px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  padding: 5px 10px;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--bg-soft);
  transition: border-color 0.15s ease;
}
.audit-link:hover { border-color: var(--accent); color: var(--accent-hover); }
.audit-admin-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  background: #B45309;
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 999px;
  vertical-align: middle;
}
@media (max-width: 700px) {
  #audit-list > div { grid-template-columns: 1fr !important; }
}

/* v50.54 — payment terms table, Advertising Key findings (charts + AI brief), consolidated MoM strip.
 * Additions the approved mockup needed on top of the GST-tab vocabulary in dashboard.html. */
.gst-table input[type="number"], .gst-table select {
  padding: 5px 7px; font-size: 12.5px; border: 1px solid var(--rule); border-radius: 6px;
  background: var(--bg-elevated); color: var(--ink); font-family: inherit;
}
.gst-table input[type="number"]:focus, .gst-table select:focus { outline: none; border-color: var(--ink); }
.gst-ops select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--rule); border-radius: 6px;
  background: var(--bg-elevated); color: var(--ink); font-family: inherit; font-size: 15px;
}
.gst-ops select:focus { outline: none; border-color: var(--ink); }
.gst-tiles.cols3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.gst-tiles.cols4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.gst-tiles.cols4 .gst-tile .v { font-size: 18px; }
.ads-obs .sev.watch { color: var(--warning); }
.ads-obs .sev.serious { color: var(--error); }
.chart { border: 1px solid var(--rule); border-radius: 8px; padding: 12px 14px 8px; background: #fff; min-width: 0; }
.chart .t { font-size: 13px; font-weight: 600; color: var(--ink); margin-bottom: 2px; }
.chart .s { font-size: 11.5px; color: var(--ink-muted); margin-bottom: 8px; }
.chart svg { width: 100%; height: auto; display: block; font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif; }
.legend { display: flex; gap: 14px; font-size: 11.5px; color: var(--ink-soft); margin-top: 6px; flex-wrap: wrap; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.ai { border: 1px solid var(--rule); border-left: 3px solid var(--accent); border-radius: 8px; padding: 12px 14px; background: #fff; font-size: 13.5px; line-height: 1.6; color: var(--ink-soft); }
.ai .h { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-muted); margin-bottom: 6px; }
.ai ol { margin: 8px 0 0 18px; padding: 0; }
.ai li { margin: 6px 0; }
.ai li b { color: var(--ink); }
.ai .meta { font-size: 11.5px; color: var(--ink-muted); margin-top: 8px; border-top: 1px dashed var(--rule); padding-top: 6px; }
@media (max-width: 860px) {
  .gst-tiles.cols3, .gst-tiles.cols4 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px) {
  .gst-tiles.cols3, .gst-tiles.cols4 { grid-template-columns: 1fr; }
}
.gst-table.tight th { white-space: normal; vertical-align: bottom; }
.gst-table.tight th, .gst-table.tight td { padding-left: 4px; padding-right: 4px; }
.gst-table.tight { font-size: 12px; }
