/* Allotrope and Inter come from the system's own font files (tokens.css). Titillium Web is only the fallback for headings. */
@import url('https://fonts.googleapis.com/css2?family=Titillium+Web:wght@600;700&display=swap');

/* SM+ Brand components. Every colour, size and radius comes from tokens.css. */

body { margin: 0; background: var(--surface); color: var(--ink); font-family: var(--font-body); font-size: 14px; line-height: 21px; }

/* Logo */
.smp-logo { display: block; flex: none; align-self: flex-start; max-width: 100%; object-fit: contain; object-position: left center; }
.smp-logo-auto { display: block; flex: none; align-self: flex-start; width: max-content; max-width: 100%; }
.smp-logo-auto .smp-logo-white { display: none; }
[data-theme="dark"] .smp-logo-auto .smp-logo-color { display: none; }
[data-theme="dark"] .smp-logo-auto .smp-logo-white { display: block; }
[data-theme="dark"] [data-theme="light"] .smp-logo-auto .smp-logo-color { display: block; }
[data-theme="dark"] [data-theme="light"] .smp-logo-auto .smp-logo-white { display: none; }

/* Section label chip */
.smp-label { display: inline-flex; align-items: center; height: 32px; padding: 0 var(--space-3); border-radius: var(--radius-sm); background: var(--label); color: var(--on-label); font-family: var(--font-display); font-size: 16px; line-height: 20px; font-weight: 500; white-space: nowrap; }

/* Brand rule: gradient line plus the curve up to the top edge */
.smp-rule { display: flex; align-items: flex-end; min-width: 0; }
.smp-rule-line { flex: 1 1 auto; height: 3px; margin-bottom: 0; background: var(--gradient-line); border-radius: 2px 0 0 2px; }
.smp-rule-curve { flex: 0 0 auto; display: block; overflow: visible; }
.smp-rule-curve path { stroke: var(--primary-red); stroke-width: 3; stroke-linecap: round; }

/* Page header (content slide and report page) */
.smp-pageheader { color: var(--ink); background: var(--surface); }
.smp-pageheader-band { position: relative; display: flex; align-items: stretch; height: 64px; }
.smp-pageheader-title { position: absolute; left: 0; right: 180px; bottom: 12px; margin: 0; font-family: var(--font-display); font-size: 18px; line-height: 22px; font-weight: 500; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.smp-pageheader-double .smp-pageheader-title { font-size: 14px; line-height: 18px; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.smp-pageheader-rule { flex: 1 1 auto; align-self: flex-end; height: 56px; }
.smp-pageheader-logo { flex: 0 0 auto; padding: 10px 0 0 var(--space-3); }
.smp-pageheader-extra { padding-top: var(--space-3); color: var(--ink-muted); }

/* Footer */
.smp-footer { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-4); padding: var(--space-2) 0; font-family: var(--font-body); font-size: 11px; line-height: 14px; color: var(--ink); }
.smp-footer-page { font-variant-numeric: tabular-nums; }

/* Bullet list: SM+ Purple rounded squares from the deck template */
.smp-bullets { list-style: none; margin: 0; padding: 0; }
.smp-bullets li { position: relative; padding-left: 20px; margin: 0 0 var(--space-2); color: var(--ink); }
.smp-bullets li::before { content: ""; position: absolute; left: 2px; top: 0.5em; width: 8px; height: 8px; border-radius: 22%; background: var(--primary-purple); }
.smp-bullets-sub { margin-top: var(--space-2); }
.smp-bullets-sub li::before { width: 6px; height: 6px; top: 0.6em; background: var(--ink-muted); }
[data-theme="dark"] .smp-bullets li::before { background: var(--accent); }

/* Brand panel: the colour usage blocks from the guide */
.smp-panel { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-5); align-items: center; padding: var(--space-5) var(--space-6); border-radius: var(--radius-md); background: var(--surface); color: var(--ink); }
.smp-panel-light-grey { background: var(--secondary-light-grey); }
.smp-panel-mid-grey { background: var(--secondary-mid-grey); }
.smp-panel-heading { margin: 0; font-family: var(--font-display); font-size: 28px; line-height: 32px; font-weight: 500; color: var(--ink); }
.smp-panel-subhead { margin: var(--space-2) 0 0; font-family: var(--font-display); font-size: 14px; line-height: 18px; font-weight: 500; color: var(--ink-subhead); }
.smp-panel-mid-grey .smp-panel-subhead { color: var(--ink); }
.smp-panel-body { font-size: 13px; line-height: 19px; color: var(--ink); }
.smp-panel-body p { margin: 0 0 var(--space-2); }
@media (max-width: 560px) { .smp-panel { grid-template-columns: 1fr; padding: var(--space-5); } }

/* Data table */
.smp-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-panel); }
.smp-table { width: 100%; border-collapse: collapse; font-family: var(--font-body); font-size: 13px; line-height: 18px; color: var(--ink); font-variant-numeric: tabular-nums; }
.smp-table caption { caption-side: top; text-align: left; padding: var(--space-3) var(--space-4); font-family: var(--font-display); font-size: 16px; font-weight: 500; color: var(--ink); }
.smp-table th, .smp-table td { padding: var(--space-2) var(--space-3); border-bottom: 1px solid var(--line); vertical-align: middle; }
.smp-table thead th { background: var(--table-header); color: var(--on-table-header); font-weight: 600; border-bottom: 0; vertical-align: bottom; }
.smp-th-label { display: block; }
.smp-th-unit { display: block; font-size: 11px; line-height: 14px; font-weight: 400; opacity: 0.85; }
.smp-table .smp-text { text-align: left; }
.smp-table .smp-num { text-align: center; white-space: nowrap; }
.smp-table tbody tr:last-child td, .smp-table tbody tr:last-child th { border-bottom: 0; }
.smp-table tfoot tr.smp-total td, .smp-table tfoot tr.smp-total th { background: var(--table-total); font-weight: 600; border-top: 2px solid var(--ink); border-bottom: 0; }

/* Letter footer (stationery) */
.smp-letterfooter { color: var(--ink); }
.smp-letterfooter-rule { height: 40px; }
.smp-letterfooter-text { padding: var(--space-3) 0 0 var(--space-7); font-family: var(--font-display); font-size: 11px; line-height: 15px; }
.smp-letterfooter-name { font-weight: 700; }
.smp-letterfooter-address sup { font-size: 0.7em; line-height: 0; }

/* App header (web apps) */
.smp-appheader { position: relative; display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); min-height: 56px; padding: 0 var(--space-5); background: var(--surface); color: var(--ink); }
.smp-appheader::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--gradient-line); }
.smp-appheader-brand { display: flex; align-items: center; gap: var(--space-3); min-width: 0; }
.smp-appheader-title { padding-left: var(--space-3); border-left: 1px solid var(--line); font-family: var(--font-display); font-size: 18px; line-height: 22px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.smp-appheader-actions { display: flex; align-items: center; gap: var(--space-3); font-size: 13px; }

/* Buttons */
.smp-btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); height: 40px; padding: 0 var(--space-4); border: 1px solid transparent; border-radius: var(--radius-sm); font-family: var(--font-body); font-size: 14px; line-height: 20px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.smp-btn-sm { height: 32px; padding: 0 var(--space-3); font-size: 13px; }
.smp-btn-primary { background: var(--action); color: var(--on-action); }
.smp-btn-primary:hover { background: var(--action-hover); }
.smp-btn-secondary { background: var(--surface-panel); color: var(--ink); border-color: var(--line-strong); }
.smp-btn-secondary:hover { background: var(--surface-muted); }
.smp-btn-quiet { background: transparent; color: var(--accent); }
.smp-btn-quiet:hover { background: var(--surface-muted); }
.smp-btn:focus-visible, .smp-input:focus-visible, .smp-tab:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.smp-btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* Form fields */
.smp-field { display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; }
.smp-field-label { font-size: 13px; line-height: 18px; font-weight: 600; color: var(--ink); }
.smp-input { box-sizing: border-box; width: 100%; height: 40px; padding: 0 var(--space-3); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface-panel); color: var(--ink); font-family: var(--font-body); font-size: 14px; line-height: 20px; }
.smp-input::placeholder { color: var(--ink-muted); }
.smp-select { appearance: none; -webkit-appearance: none; padding-right: 36px; background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.smp-field-msg { margin: 0; font-size: 12px; line-height: 16px; color: var(--ink-muted); }
.smp-field-error .smp-input { border-color: var(--status-danger); border-width: 2px; }
.smp-field-msg-error { color: var(--ink); display: flex; align-items: center; gap: var(--space-2); }
.smp-field-msg-error::before { content: ""; flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%; background: var(--status-danger); }

/* Tabs */
.smp-tabs { display: flex; gap: var(--space-5); border-bottom: 1px solid var(--line); overflow-x: auto; }
.smp-tab { position: relative; padding: var(--space-3) 0; border: 0; background: none; color: var(--ink-muted); font-family: var(--font-body); font-size: 14px; line-height: 20px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.smp-tab:hover { color: var(--ink); }
.smp-tab-on { color: var(--ink); }
.smp-tab-on::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; border-radius: 2px 2px 0 0; background: var(--accent); }

/* Badge */
.smp-badge { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 var(--space-2); border-radius: var(--radius-sm); background: var(--surface-muted); color: var(--ink); font-family: var(--font-body); font-size: 12px; line-height: 16px; font-weight: 600; white-space: nowrap; }
.smp-badge-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line-strong); }
.smp-badge-success { background: var(--status-success-soft); }
.smp-badge-success .smp-badge-dot { background: var(--status-success); }
.smp-badge-warning { background: var(--status-warning-soft); }
.smp-badge-warning .smp-badge-dot { background: var(--status-warning); }
.smp-badge-danger { background: var(--status-danger-soft); }
.smp-badge-danger .smp-badge-dot { background: var(--status-danger); }
.smp-badge-info { background: var(--status-info-soft); }
.smp-badge-info .smp-badge-dot { background: var(--status-info); }

/* Card */
.smp-card { border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-panel); color: var(--ink); }
.smp-card-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-4) var(--space-5) 0; }
.smp-card-title { margin: 0; font-family: var(--font-display); font-size: 18px; line-height: 22px; font-weight: 500; }
.smp-card-body { padding: var(--space-4) var(--space-5) var(--space-5); }

/* Stat tile */
.smp-stat { padding: var(--space-4) var(--space-5); border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-panel); color: var(--ink); }
.smp-stat-label { font-size: 13px; line-height: 18px; font-weight: 600; color: var(--ink-muted); }
.smp-stat-value { margin-top: var(--space-1); font-family: var(--font-display); font-size: 32px; line-height: 38px; font-weight: 500; font-variant-numeric: tabular-nums; }
.smp-stat-unit { margin-left: var(--space-1); font-family: var(--font-body); font-size: 13px; line-height: 18px; font-weight: 400; color: var(--ink-muted); }
.smp-stat-note { margin-top: var(--space-1); font-size: 12px; line-height: 16px; color: var(--ink-muted); }
