/* Purple Dinosaur brand tokens, taken from the TDW4 dashboard reference. */
:root {
    --bg: #f6f4f8;
    --card: #ffffff;
    --ink: #1c2733;
    --muted: #64748b;
    --border: #e2e8f0;
    --accent: #5b2a63;
    --pd-purple: #321235;
    --pd-purple-dark: #1c0b1e;
    --pd-yellow: #f4cf2a;
    --good: #16a34a;
    --warn: #d97706;
    --bad: #dc2626;
}

html { font-size: 15px; }

body {
    background: var(--bg);
    color: var(--ink);
    font-family: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.pd-header {
    background: linear-gradient(135deg, var(--pd-purple), var(--pd-purple-dark));
    color: #fff;
}

.pd-brand {
    color: #fff;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: .08em;
    font-weight: 700;
    font-size: 1.15rem;
}

.pd-brand span { color: #c9b9cd; font-weight: 500; }

.pd-tenant {
    background: var(--pd-yellow);
    color: var(--pd-purple-dark);
    font-weight: 600;
    border-radius: 999px;
    padding: .15rem .75rem;
    font-size: .85rem;
}

.pd-link { color: #e6dcea; text-decoration: none; }
.pd-link:hover, .pd-link:focus { color: #fff; text-decoration: underline; }
.pd-user { color: #c9b9cd; font-size: .85rem; }
.pd-footer { color: var(--muted); font-size: .8rem; }

.pd-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 18px 20px;
    margin-bottom: 20px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 1px 3px rgba(0, 0, 0, .06);
}

.pd-card h1, .pd-card h2, .pd-title {
    color: var(--pd-purple);
    text-transform: uppercase;
    letter-spacing: .04em;
    font-weight: 700;
}

.pd-title { font-size: 1.4rem; margin-bottom: 1rem; }

.pd-muted { color: var(--muted); }

.btn-pd { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-pd:hover, .btn-pd:focus { background: var(--pd-purple); border-color: var(--pd-purple); color: #fff; }

.table thead th {
    text-transform: uppercase;
    font-size: .72rem;
    letter-spacing: .05em;
    color: var(--muted);
}

.category-child td:first-child { padding-left: 2rem; }

.form-narrow { max-width: 34rem; }

.credential {
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 1.15rem;
    background: #fff8d6;
    border: 1px dashed var(--warn);
    border-radius: 8px;
    padding: .5rem .75rem;
    user-select: all;
}

/* Overview */
.pd-filters label { font-size: .8rem; color: var(--muted); font-weight: 600; }

.pd-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.pd-kpi {
    background: var(--card);
    border: 1px solid var(--border);
    border-top: 3px solid var(--pd-yellow);
    border-radius: 12px;
    padding: 12px 14px;
}

.pd-kpi-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
.pd-kpi-value { font-size: 1.6rem; font-weight: 700; color: var(--pd-purple); line-height: 1.2; }
.pd-kpi-value[data-state="NotApplicable"], .pd-kpi-value[data-state="NotAvailable"] { color: var(--muted); }
.pd-kpi-note { font-size: .75rem; color: var(--muted); }
.pd-kpi-change { font-size: .8rem; font-weight: 600; }
.pd-kpi-change.good { color: var(--good); }
.pd-kpi-change.bad { color: var(--bad); }
.pd-kpi-change.neutral { color: var(--muted); }

.pd-chart { position: relative; height: 280px; }
.pd-quality h2 { color: var(--pd-purple); text-transform: uppercase; letter-spacing: .04em; font-weight: 700; }

.pd-kpis-secondary .pd-kpi { border-top-color: var(--border); padding: 8px 12px; }
.pd-kpis-secondary .pd-kpi-value { font-size: 1.15rem; }

/* By category */
.pd-sort { background: none; border: 0; padding: 0; font: inherit; font-weight: 600; color: inherit; cursor: pointer; }
.pd-sort:hover, .pd-sort:focus-visible { text-decoration: underline; }
.pd-sortable thead th { white-space: nowrap; }
.pd-child-row td, .pd-child-row th { color: var(--muted); }
.pd-crosssell-trigger { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; text-decoration: underline dotted; }
.pd-crosssell-trigger:hover, .pd-crosssell-trigger:focus-visible { text-decoration: underline; }

/* Reporting category multi select */
.pd-multiselect { position: relative; }
.pd-multiselect > summary { list-style: none; cursor: pointer; }
.pd-multiselect > summary::-webkit-details-marker { display: none; }
.pd-multiselect-panel { position: absolute; z-index: 30; left: 0; min-width: 100%; width: max-content; max-width: 90vw; max-height: 320px; overflow: auto; padding: 8px 12px; background: var(--card); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 6px 18px rgba(0,0,0,.12); }

/* Campaign table */
.pd-campaigns thead th { white-space: nowrap; }
.pd-chip { display: inline-block; min-width: 3.6em; padding: 1px 8px; border-radius: 6px; color: #fff; font-weight: 600; text-align: center; }
.pd-chip-good { background: #2b8a3e; }
.pd-chip-mid { background: #8a6d00; }
.pd-chip-poor { background: #c92a2a; }

/* One-page Overview sections */
.pd-jump { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 4px 0 12px; font-size: .85rem; }
.pd-jump a { color: var(--pd-purple); font-weight: 600; text-decoration: none; }
.pd-jump a:hover, .pd-jump a:focus-visible { text-decoration: underline; }
.pd-section { font-size: 1.1rem; font-weight: 700; color: var(--pd-purple); margin: 24px 0 10px; scroll-margin-top: 12px; }
.pd-detail-link { font-size: .78rem; font-weight: 600; margin-left: 12px; }

/* Attribution sub-navigation */
.pd-subnav { display: flex; flex-wrap: wrap; gap: 4px 20px; margin: 0 0 14px; border-bottom: 1px solid var(--border); }
.pd-subnav a { padding: 6px 0; color: var(--muted); font-weight: 600; text-decoration: none; border-bottom: 3px solid transparent; }
.pd-subnav a:hover, .pd-subnav a:focus-visible { color: var(--pd-purple); }
.pd-subnav a.active { color: var(--pd-purple); border-bottom-color: var(--pd-yellow); }
