:root {
    --da-blue: #2eafd4;
    --da-dark: #0d2a3a;
    --da-light1: #e8f7fc;
    --da-light2: #f0f7fa;
    --da-gray: #4b5563;
    --da-gray-light: #e5e7eb;
    --da-success: #10b981;
    --da-warning: #f59e0b;
    --da-accent1: #ec4899;
    --da-accent2: #8b5cf6;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* SKIP LINK */
.skip-link {
    position: absolute;
    top: -100%;
    left: 8px;
    background: var(--da-blue);
    color: white;
    padding: 8px 16px;
    border-radius: 0 0 6px 6px;
    font-weight: 600;
    z-index: 1000;
    text-decoration: none;
}

.skip-link:focus {
    top: 0;
}

/* FOCUS STYLES */
button:focus-visible,
a:focus-visible,
[role="button"]:focus-visible,
input:focus-visible,
[tabindex="0"]:focus-visible {
    outline: 3px solid var(--da-blue);
    outline-offset: 2px;
}

/* Definition list reset for KPI cards */
dl { margin: 0; }
dt, dd { margin: 0; }

/* Visually hidden (screen reader only) */
/* LOGO */
.site-logo {
    display: block;
    max-width: 100%;
    height: auto;
}
/* Invert logo colours when on dark sidebar backgrounds */
.dashboard-sidebar .site-logo,
.admin-sidebar .site-logo {
    filter: brightness(0) invert(1);
}
.sidebar-logo-sub {
    font-size: 11px;
    color: rgba(255,255,255,0.7);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 4px;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

body {
    font-family: 'DM Sans', sans-serif;
    background: #f9fafb;
    color: #1f2937;
}

/* GENERAL */
.container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

button {
    font-family: 'DM Sans', sans-serif;
    cursor: pointer;
    border: none;
    border-radius: 6px;
    padding: 10px 16px;
    font-weight: 600;
    transition: all 0.3s ease;
}

button:hover {
    transform: translateY(-2px);
}

button.primary {
    background: var(--da-blue);
    color: white;
}

button.primary:hover {
    background: #2295b8;
}

button.secondary {
    background: transparent;
    color: var(--da-blue);
    border: 1px solid var(--da-blue);
}

button.secondary:hover {
    background: var(--da-light1);
}

button.danger {
    background: #ef4444;
    color: white;
}

button.danger:hover {
    background: #dc2626;
}

input {
    font-family: 'DM Sans', sans-serif;
    padding: 12px 16px;
    border: 1px solid var(--da-gray-light);
    border-radius: 6px;
    font-size: 16px;
    transition: all 0.3s ease;
}

input:focus {
    outline: none;
    border-color: var(--da-blue);
    box-shadow: 0 0 0 3px rgba(46, 175, 212, 0.1);
}

/* LOGIN */
body.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--da-dark) 0%, #1a3a4a 100%);
    min-height: 100vh;
}

.login-card {
    background: white;
    border-radius: 12px;
    padding: 48px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.login-logo {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo h1 {
    font-family: 'Syne', sans-serif;
    font-size: 32px;
    font-weight: 700;
    color: var(--da-dark);
    margin-bottom: 8px;
}

.login-logo p {
    font-size: 14px;
    color: var(--da-gray);
    font-weight: 500;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.login-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

@media (max-width: 420px) {
    .login-row {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

.login-form[hidden] {
    display: none;
}

.login-form label {
    font-weight: 600;
    font-size: 14px;
    color: var(--da-dark);
    margin-bottom: 4px;
    display: block;
}

.login-form input {
    width: 100%;
}

.login-button {
    width: 100%;
    padding: 12px;
    font-size: 16px;
}

.login-footer {
    text-align: center;
    font-size: 12px;
    color: var(--da-gray);
    padding-top: 16px;
    border-top: 1px solid var(--da-gray-light);
}

.login-hint {
    margin: 6px 0 0;
    font-size: 13px;
    color: var(--da-gray);
}

.login-info {
    margin: 0;
    padding: 12px 14px;
    border-left: 4px solid #0e7490;
    border-radius: 6px;
    background: var(--da-light1);
    color: var(--da-dark);
    font-size: 14px;
    line-height: 1.5;
}

.login-alt {
    margin: 0 0 20px;
    text-align: center;
    font-size: 14px;
}

.login-alt a,
.access-alert a {
    color: #0b6b85;
    font-weight: 600;
    text-decoration: underline;
}

.login-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: -8px 0 16px;
    font-size: 13px;
    color: var(--da-gray);
}

.login-divider::before,
.login-divider::after {
    content: "";
    flex: 1;
    border-top: 1px solid var(--da-gray-light);
}

/* Sign in with Google / Microsoft */
.login-oauth {
    display: grid;
    gap: 10px;
    margin-bottom: 20px;
}

.login-oauth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 11px 12px;
    border: 1px solid #8c8c8c;
    border-radius: 8px;
    background: #fff;
    color: #1f1f1f;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

.login-oauth-btn:hover { background: #f5f5f5; }
.login-oauth-btn:focus-visible { outline: 3px solid #0b6b85; outline-offset: 2px; }
.login-oauth-btn:disabled { opacity: .6; cursor: wait; }
.login-oauth-btn svg { flex: none; width: 20px; height: 20px; }

.login-textbtn {
    padding: 4px 0;
    border: 0;
    background: none;
    color: #0b6b85;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
}

.login-textrow {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px;
}

.login-notice {
    margin-bottom: 24px;
    font-size: 15px;
    line-height: 1.55;
    color: var(--da-dark);
}

.login-notice h1 {
    font-family: 'Syne', sans-serif;
    font-size: 22px;
    margin-bottom: 12px;
}

.login-notice p {
    margin: 0 0 12px;
    overflow-wrap: anywhere;
}

/* Two-step verification (two-factor.html) */
.tf-steps {
    margin: 0 0 12px;
    padding-left: 20px;
}

.tf-steps li {
    margin-bottom: 6px;
}

.tf-qr {
    display: block;
    margin: 0 auto 12px;
    padding: 8px;
    background: white;
    border: 1px solid var(--da-gray-light);
    border-radius: 8px;
}

.tf-secret {
    display: inline-block;
    margin-top: 6px;
    padding: 6px 10px;
    border-radius: 6px;
    background: var(--da-light2);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 14px;
    letter-spacing: 0.04em;
    overflow-wrap: anywhere;
    user-select: all;
}

/* CLIENT SELECTOR */
body.client-page {
    display: flex;
    flex-direction: column;
    background: var(--da-light2);
    min-height: 100vh;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 32px;
    background: white;
    border-bottom: 1px solid var(--da-gray-light);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.topbar h1 {
    font-family: 'Syne', sans-serif;
    font-size: 24px;
    color: var(--da-dark);
    font-weight: 700;
    margin: 0;
    line-height: 1.2;
}

.topbar-action button {
    padding: 8px 16px;
    font-size: 14px;
}

.client-content {
    flex: 1;
    overflow-y: auto;
    padding: 32px;
}

.client-selector-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--da-dark);
    margin-bottom: 24px;
}

.client-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
    gap: 24px;
}

.client-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.client-card.available {
    cursor: pointer;
    border-color: var(--da-blue);
}

.client-card.available:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(46, 175, 212, 0.2);
}

.client-card.coming-soon {
    opacity: 0.6;
    cursor: not-allowed;
}

.client-card h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--da-dark);
    margin-bottom: 12px;
}

.client-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.client-meta-item {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: var(--da-gray);
}

.client-meta-item strong {
    color: var(--da-dark);
    font-weight: 600;
}

.client-status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-top: 12px;
}

.client-status.available {
    background: var(--da-light1);
    color: var(--da-blue);
}

.client-status.coming-soon {
    background: #fee2e2;
    color: #dc2626;
}

/* REPORT LIST */
body.report-page {
    display: flex;
    flex-direction: column;
    background: var(--da-light2);
    min-height: 100vh;
}

.report-header {
    padding: 20px 32px;
    background: white;
    border-bottom: 1px solid var(--da-gray-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.report-header h1 {
    font-size: 22px;
    font-weight: 700;
    color: var(--da-dark);
    margin: 0;
    line-height: 1.2;
}

.report-content {
    flex: 1;
    overflow-y: auto;
    padding: 32px;
}

.report-list-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--da-dark);
    margin-bottom: 24px;
}

.report-grid {
    display: grid;
    /* auto-fill keeps a lone card at column width instead of stretching it */
    grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
    gap: 24px;
}

/* Keep the pickers readable on wide screens. */
.report-content > *,
.client-page .client-content:not(.access-requests) > * {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.report-header img {
    display: block;
}

/* Card footer on the client and report pickers: an optional flag and a
   visible "what happens when I click" line. */
.card-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--da-gray-light);
}

.card-cta {
    margin-left: auto;
    font-size: 14px;
    font-weight: 600;
    color: #0b6b85;
}

.client-card.available:hover .card-cta,
.report-card.available:hover .card-cta {
    text-decoration: underline;
}

.card-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    background: #fef3c7;
    color: #92400e;
    font-size: 12px;
    font-weight: 600;
}

.client-card [role="button"],
.report-card [role="button"] {
    border-radius: 8px;
}

.report-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    border-left: 4px solid var(--da-blue);
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.report-card.available {
    cursor: pointer;
}

.report-card.available:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(46, 175, 212, 0.2);
}

.report-card.coming-soon {
    opacity: 0.6;
    cursor: not-allowed;
    border-left-color: #d1d5db;
}

.report-card h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--da-dark);
    margin-bottom: 12px;
}

.report-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.report-meta-item {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: var(--da-gray);
}

.report-meta-item strong {
    color: var(--da-dark);
    font-weight: 600;
}

.report-status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-top: 12px;
    background: var(--da-light1);
    color: var(--da-blue);
}

.report-status.coming-soon {
    background: #fee2e2;
    color: #dc2626;
}

/* DASHBOARD */
body.dashboard-page {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

.dashboard-sidebar {
    width: 280px;
    background: var(--da-dark);
    color: white;
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    overflow-y: auto;
}

.sidebar-logo {
    padding: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-logo h1 {
    font-family: 'Syne', sans-serif;
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
}

.sidebar-logo p {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
}

.sidebar-nav {
    flex: 1;
    padding: 24px 16px;
}

.nav-section {
    margin-bottom: 24px;
}

.nav-section-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 12px;
    padding: 0 8px;
    font-weight: 700;
}

.nav-item {
    padding: 10px 12px;
    margin-bottom: 8px;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s ease;
    color: rgba(255, 255, 255, 0.85);
}

.nav-item:hover {
    opacity: 1;
    background: rgba(46, 175, 212, 0.2);
}

.nav-item.active {
    background: var(--da-blue);
    opacity: 1;
    font-weight: 600;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-footer button {
    width: 100%;
    background: rgba(239, 68, 68, 0.8);
    color: white;
    font-size: 13px;
    padding: 8px;
}

.sidebar-footer button:hover {
    background: #dc2626;
}

.dashboard-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.dashboard-topbar {
    padding: 20px 32px;
    background: white;
    border-bottom: 1px solid var(--da-gray-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.dashboard-title {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.dashboard-title h1 {
    font-size: 20px;
    font-weight: 700;
    color: var(--da-dark);
    margin: 0;
    line-height: 1.2;
}

.dashboard-title p {
    font-size: 13px;
    color: var(--da-gray);
}

.dashboard-topbar-action button {
    margin-left: 12px;
}

.dashboard-content {
    flex: 1;
    padding: 32px;
    overflow-y: auto;
}

/* KPI CARDS */
.kpi-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.kpi-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border-left: 4px solid var(--da-blue);
}

.kpi-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--da-gray);
    font-weight: 600;
    margin-bottom: 8px;
}

.kpi-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--da-dark);
    font-family: 'Syne', sans-serif;
}

.kpi-subtext {
    font-size: 12px;
    color: var(--da-gray);
    margin-top: 8px;
}

/* CHART SECTIONS */
.chart-section {
    background: white;
    border-radius: 12px;
    padding: 28px;
    margin-bottom: 32px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Reserved views not built yet (Survey Pulse, map) — section-manifest "placeholder" */
.placeholder-card {
    border: 2px dashed var(--da-light1);
    border-radius: 10px;
    padding: 24px;
    text-align: center;
    color: var(--da-gray);
}

.placeholder-card p {
    max-width: 560px;
    margin: 12px auto 0;
    font-size: 14px;
    line-height: 1.5;
}

.placeholder-badge {
    display: inline-block;
    align-self: center;
    width: fit-content;
    padding: 4px 12px;
    border-radius: 12px;
    background: var(--da-light1);
    color: var(--da-dark);
    font-size: 12px;
    font-weight: 600;
}

/* Admin warning when the Pointerpro sync is failing (clients.html) */
.sync-alert {
    margin-bottom: 24px;
    padding: 16px 20px;
    border-left: 4px solid #b91c1c;
    border-radius: 8px;
    background: #fef2f2;
    color: #7f1d1d;
    font-size: 14px;
    line-height: 1.5;
}

.sync-alert ul {
    margin: 8px 0;
    padding-left: 20px;
}

.sync-alert p {
    margin: 0;
    color: #7f1d1d;
}

/* Access requests (admin banner on clients.html + access-requests.html) */
.access-alert {
    margin-bottom: 24px;
    padding: 16px 20px;
    border-left: 4px solid #0e7490;
    border-radius: 8px;
    background: var(--da-light1);
    color: var(--da-dark);
    font-size: 14px;
    line-height: 1.5;
}

.access-requests {
    max-width: 860px;
    width: 100%;
    margin: 0 auto;
}

.access-requests h1.client-selector-title {
    font-size: 22px;
    margin-bottom: 8px;
}

.access-intro,
#accessStatus {
    margin: 0 0 16px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--da-gray);
}

#accessStatus {
    color: var(--da-dark);
    font-weight: 600;
}

.access-card {
    margin-bottom: 16px;
    padding: 20px 24px;
    background: white;
    border: 1px solid var(--da-gray-light);
    border-radius: 10px;
}

.access-card h2 {
    font-size: 17px;
    margin: 0 0 10px;
    color: var(--da-dark);
    overflow-wrap: anywhere;
}

.access-meta {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 4px 16px;
    margin: 0 0 14px;
    font-size: 14px;
}

.access-meta dt {
    color: var(--da-gray);
}

.access-meta dd {
    margin: 0;
    color: var(--da-dark);
    overflow-wrap: anywhere;
}

.access-clients {
    margin: 0 0 14px;
    padding: 12px 14px;
    border: 1px solid var(--da-gray-light);
    border-radius: 8px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 6px 16px;
}

.access-clients legend {
    padding: 0 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--da-dark);
}

.access-check {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 28px;
    font-size: 14px;
}

.access-check input {
    width: 18px;
    height: 18px;
    padding: 0;
    flex: none;
}

.access-actions {
    display: flex;
    gap: 8px;
}

.access-actions button {
    padding: 8px 18px;
    font-size: 14px;
}

.access-error {
    margin: 0 0 10px;
    color: #b91c1c;
    font-size: 13px;
}

.access-error:empty {
    display: none;
}

.access-note {
    margin: 0;
    font-size: 14px;
    color: var(--da-gray);
}

#otherRequests {
    margin-top: 24px;
}

#otherRequests summary {
    margin-bottom: 12px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: var(--da-dark);
}

/* Admin area (users.html, surveys.html, access-requests.html) */
.admin-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 20px;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--da-gray-light);
    font-size: 14px;
}

.admin-nav a,
.access-link {
    color: #0b6b85;
    font-weight: 600;
    text-decoration: none;
}

.admin-nav a:hover,
.access-link:hover {
    text-decoration: underline;
}

.admin-nav a[aria-current="page"] {
    color: var(--da-dark);
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 6px;
}

.access-badge {
    display: inline-block;
    margin-left: 4px;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--da-gray-light);
    color: #374151;
    font-size: 12px;
    font-weight: 600;
    vertical-align: middle;
}

.access-badge.is-admin {
    background: var(--da-dark);
    color: white;
}

.access-badge.is-live {
    background: #d1fae5;
    color: #065f46;
}

.access-actions {
    flex-wrap: wrap;
    align-items: center;
}

.access-confirm {
    flex: 1 0 100%;
    margin: 0 0 4px;
    font-size: 14px;
    font-weight: 600;
    color: var(--da-dark);
}

/* Map of Australia (section-manifest "map") */
.au-map-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    align-items: flex-start;
}

.au-map-svg {
    flex: 1 1 380px;
    max-width: 560px;
    height: auto;
}

.au-state path,
.au-act-marker {
    stroke: #ffffff;
    stroke-width: 1.2;
    transition: opacity 0.15s;
}

.au-state.clickable {
    cursor: pointer;
}

.au-state.clickable:hover path,
.au-state.clickable:hover .au-act-marker {
    stroke: var(--da-dark);
    stroke-width: 2;
}

.au-state:focus {
    outline: none;
}

.au-state:focus-visible path,
.au-state:focus-visible .au-act-marker {
    stroke: var(--da-dark);
    stroke-width: 3;
}

.au-map-svg.has-selection .au-state:not(.selected) {
    opacity: 0.4;
}

.au-state.selected path,
.au-state.selected .au-act-marker {
    stroke: var(--da-dark);
    stroke-width: 2.5;
}

.au-leader {
    stroke: var(--da-dark);
    stroke-width: 1;
}

.au-label {
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    font-weight: 700;
    fill: var(--da-dark);
    text-anchor: middle;
    pointer-events: none;
}

.au-label-pct {
    font-size: 12px;
    font-weight: 500;
}

.au-label-small {
    font-size: 10px;
}

.au-label.on-dark {
    fill: #ffffff;
}

.au-map-side {
    flex: 1 1 260px;
    min-width: 240px;
}

.au-map-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.au-map-table th,
.au-map-table td {
    padding: 7px 8px;
    border-bottom: 1px solid #eef2f5;
    text-align: right;
}

.au-map-table th[scope="row"],
.au-map-table thead th:first-child {
    text-align: left;
}

.au-map-table thead th {
    font-size: 12px;
    font-weight: 600;
    color: var(--da-gray);
}

.au-map-table th[scope="row"] {
    font-weight: 500;
    color: var(--da-dark);
}

.au-map-table tr.selected {
    background: var(--da-light1);
}

.au-swatch {
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-right: 8px;
    border-radius: 3px;
    vertical-align: -1px;
}

.au-row-btn {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    color: inherit;
    cursor: pointer;
    text-align: left;
    text-decoration: underline;
    text-decoration-color: #c4d3dc;
    text-underline-offset: 3px;
}

.au-row-btn:hover,
.au-row-btn[aria-pressed="true"] {
    text-decoration-color: var(--da-dark);
}

.au-map-note {
    margin-top: 12px;
    font-size: 13px;
    color: var(--da-gray);
}

.section-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--da-dark);
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--da-light1);
}

/* BAR CHARTS */
.bar-chart {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.bar-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bar-label {
    flex: 0 0 200px;
    font-size: 13px;
    color: var(--da-dark);
    font-weight: 500;
    line-height: 1.4;
}

.bar-container {
    flex: 1;
    background: var(--da-light1);
    border-radius: 4px;
    height: 28px;
    position: relative;
    overflow: hidden;
}

.bar {
    height: 100%;
    background: linear-gradient(90deg, var(--da-blue), #1e8fb8);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 8px;
    animation: slideIn 0.8s ease-out;
}

@keyframes slideIn {
    from {
        width: 0;
    }
}

.bar-value {
    flex: 0 0 80px;
    text-align: right;
    font-size: 13px;
    font-weight: 600;
    color: var(--da-dark);
}

/* INTENT PILLS */
.intent-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
}

.intent-pill {
    background: linear-gradient(135deg, var(--da-light1), var(--da-light2));
    border: 1px solid var(--da-blue);
    border-radius: 20px;
    padding: 16px;
    text-align: center;
    transition: all 0.3s ease;
}

.intent-pill:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(46, 175, 212, 0.2);
}

.intent-pill-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--da-blue);
    font-family: 'Syne', sans-serif;
}

.intent-pill-label {
    font-size: 12px;
    color: var(--da-gray);
    margin-top: 8px;
}

/* DONUT CHARTS */
.donut-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 32px;
    margin-top: 24px;
}

.donut-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.donut-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--da-dark);
    margin-bottom: 16px;
    text-align: center;
}

canvas {
    max-width: 220px;
    max-height: 220px;
}

.donut-legend {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 16px;
    font-size: 12px;
}

.donut-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.donut-legend-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
}

/* VERBATIMS */
.verbatim-item {
    padding: 16px;
    background: var(--da-light1);
    border-left: 3px solid var(--da-blue);
    border-radius: 6px;
    margin-bottom: 12px;
    font-size: 13px;
    line-height: 1.6;
    color: var(--da-dark);
    font-style: italic;
}

.verbatim-item::before {
    content: '"';
    font-size: 20px;
    color: var(--da-blue);
    margin-right: 4px;
}

/* RESPONSIVE */
@media (max-width: 1024px) {
    .dashboard-sidebar {
        width: 220px;
    }

    .bar-label {
        flex: 0 0 150px;
    }

    .dashboard-content {
        padding: 24px;
    }
}

@media (max-width: 768px) {
    body.dashboard-page {
        flex-direction: column;
    }

    .dashboard-sidebar {
        width: 100%;
        max-height: 60px;
        flex-direction: row;
        align-items: center;
        padding: 0 16px;
        overflow: visible;
    }

    .sidebar-logo {
        border: none;
        padding: 0;
        margin-right: 24px;
    }

    .sidebar-nav {
        padding: 0;
        display: flex;
        gap: 24px;
        flex: 1;
    }

    .nav-section {
        margin: 0;
    }

    .nav-section-title {
        display: none;
    }

    .nav-item {
        margin: 0;
        padding: 8px;
    }

    .sidebar-footer {
        border: none;
        padding: 0;
        margin-left: auto;
    }

    .sidebar-footer button {
        width: auto;
        padding: 8px 12px;
        font-size: 12px;
    }

    .dashboard-main {
        height: auto;
        flex: 1;
    }

    .kpi-section {
        grid-template-columns: repeat(2, 1fr);
    }

    .bar-label {
        flex: 0 0 100px;
        font-size: 12px;
    }

    .donut-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    /* ── MOBILE TOP NAV ─────────────────────────────────────────────────── */
    .topbar,
    .report-header,
    .dashboard-topbar {
        flex-wrap: wrap;
        padding: 16px;
        gap: 12px;
    }

    /* Title / logo takes the full first row */
    .dashboard-title,
    .report-header > div:first-child,
    .topbar > a:first-child {
        flex: 1 1 100%;
    }

    .dashboard-title h1,
    .report-header h1 {
        font-size: 18px;
    }

    /* Action groups become a full-width second row of equal buttons */
    .topbar-action,
    .dashboard-topbar .topbar-action {
        display: flex;
        width: 100%;
        gap: 8px;
    }

    .topbar-action button,
    .dashboard-topbar .topbar-action button,
    .report-header > button {
        flex: 1;
        white-space: nowrap;
        padding: 10px 12px;
    }

    /* Client and report pickers: 16px side gutter on phones */
    .report-content,
    .client-page .client-content {
        padding: 24px 16px;
    }

    .report-grid,
    .client-grid {
        gap: 16px;
    }

    .client-card,
    .report-card {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .dashboard-title h1,
    .report-header h1 {
        font-size: 16px;
    }
}

/* ── PRINT / PDF EXPORT ───────────────────────────────────────────────────── */
@media print {
    @page {
        size: A4 portrait;
        margin: 16mm 14mm;
    }

    /* Hide chrome that doesn't belong in the PDF */
    .skip-link,
    nav.dashboard-sidebar,
    #backBtn,
    .sidebar-footer,
    .dashboard-topbar .topbar-action { display: none !important; }

    /* Full-width single-column layout */
    body.dashboard-page {
        display: block;
        height: auto;
        background: white;
    }

    .dashboard-main {
        display: block;
        overflow: visible;
    }

    .dashboard-topbar {
        padding: 0 0 12px;
        border-bottom: 2px solid #0d2a3a;
        margin-bottom: 20px;
        box-shadow: none;
    }

    .dashboard-title h1 {
        font-size: 22px;
        color: #0d2a3a;
    }

    .dashboard-title p {
        font-size: 13px;
        color: #4b5563;
    }

    /* Print header: logo line */
    .dashboard-topbar::before {
        content: "CC Data  |  Confidential";
        display: block;
        font-size: 10px;
        color: #4b5563;
        letter-spacing: 0.5px;
        text-transform: uppercase;
        margin-bottom: 8px;
    }

    .dashboard-content {
        padding: 0;
        overflow: visible;
    }

    /* KPI cards — 2 per row on print */
    .kpi-section {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        margin-bottom: 20px;
    }

    .kpi-card {
        box-shadow: none;
        border: 1px solid #e5e7eb;
        padding: 14px;
    }

    .kpi-value { font-size: 26px; }

    /* Chart sections — no box shadow, tighter padding */
    .chart-section {
        box-shadow: none;
        border: 1px solid #e5e7eb;
        padding: 18px;
        margin-bottom: 16px;
        break-inside: avoid;
    }

    /* Avoid splitting a chart across pages */
    .bar-chart,
    .donut-grid,
    .intent-section { break-inside: avoid; }

    /* Donuts — 3 per row on print */
    .donut-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }

    canvas { max-width: 160px; max-height: 160px; }

    /* Verbatims — allow break between items but not within */
    .verbatim-item { break-inside: avoid; }

    /* Ensure backgrounds print (for bar fills) */
    * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
