/* ==========================================================================
   Relief Applications — DPO Portal
   Design system foundation (verbatim port of the v2 mock tokens).
   Page-level layouts (dashboard charts, kanban, chat, magazine report)
   are restyled in their own sub-projects.
   ========================================================================== */

/* ---------- Tokens ------------------------------------------------------- */
:root {
    /* Surface */
    --black: #161718;
    --bg: #F5F5F5;
    --white: #FFFFFF;
    --stroke: #E4E6E7;

    /* Text */
    --ink: #070916;
    --grey: #4F5158;
    --grey-2: #94969E;

    /* Brand */
    --red: #FD1D1D;
    --red-pure: #FD0024;
    --red-acc: #EB1414;
    --red-grad: linear-gradient(135deg, #FD1D1D 0%, #EB1414 100%);
    --red-soft-grad: linear-gradient(180deg, #FFF6F6 0%, #FFFFFF 70%);
    --light-red: #FFF0F0;
    --light-purple: #ECF0FE;

    /* Status (mock collapses semantic colours into red/grey tints) */
    --green: #EB1414; --green-bg: #FFF0F0; --green-bd: #F6D6D6;
    --amber: #161718; --amber-bg: #F1F1F2; --amber-bd: #E1E2E4;
    --blue:  #4F5158; --blue-bg:  #F5F5F5; --blue-bd:  #E4E6E7;
    --slate: #94969E; --slate-bg: #F7F7F8; --slate-bd: #E8E9EB;

    /* Elevation */
    --shadow-sm: 0 1px 2px rgba(7,9,22,.04), 0 1px 1px rgba(7,9,22,.03);
    --shadow-md: 0 4px 16px -6px rgba(7,9,22,.10), 0 2px 6px -4px rgba(7,9,22,.06);
    --shadow-lg: 0 18px 50px -22px rgba(7,9,22,.22);

    /* Geometry */
    --radius: 16px;
    --radius-sm: 11px;

    /* Type */
    --sans: 'Hanken Grotesk', ui-sans-serif, system-ui, -apple-system, sans-serif;
    --display: 'Schibsted Grotesk', ui-sans-serif, system-ui, sans-serif;
}

/* ---------- Reset / base ------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: var(--sans);
    font-size: 14px;
    line-height: 1.5;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-feature-settings: "ss01", "tnum" 0;
}
a { color: var(--ink); text-decoration: none; transition: color 150ms ease-out; }
a:hover { color: var(--red-acc); }
button { font-family: inherit; font-size: inherit; }
input, select, textarea { font-family: inherit; font-size: inherit; color: var(--ink); }

/* Decorative top strip (drawn on body so it covers login + portal alike) */
body::before {
    content: "";
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: var(--red-grad);
    z-index: 200;
}

/* ---------- Typography --------------------------------------------------- */
h1, h2, h3, h4 {
    font-family: var(--display);
    font-weight: 700;
    margin: 0;
    color: var(--ink);
    letter-spacing: -0.02em;
}
h1 { font-size: 33px; line-height: 1.15; letter-spacing: -0.025em; }
h2 { font-size: 22px; line-height: 1.25; }
h3 { font-size: 18px; line-height: 1.3; }
h4 { font-size: 15px; line-height: 1.4; font-weight: 600; }
strong, b { font-weight: 600; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- Layout ------------------------------------------------------- */
.app {
    display: grid;
    grid-template-columns: 268px 1fr;
    min-height: 100vh;
}
.main-col { display: flex; flex-direction: column; min-width: 0; }
.content {
    padding: 36px 38px 64px;
    max-width: 1280px;
    width: 100%;
}

/* ---------- Sidebar ------------------------------------------------------ */
.sidebar {
    background: var(--white);
    border-right: 1px solid var(--stroke);
    padding: 26px 18px 22px;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
}
.brand {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 4px 8px 22px;
}
.brand .mark {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
}
.brand .mark img {
    width: 36px;
    height: 36px;
    display: block;
    filter: drop-shadow(0 5px 12px rgba(253, 0, 36, 0.30));
}
.brand .name {
    font-family: var(--display);
    font-weight: 700;
    font-size: 16px;
    color: var(--red-acc);
    letter-spacing: -0.02em;
    line-height: 1;
}
.brand .sub {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.16em;
    color: var(--grey-2);
    margin-top: 5px;
    text-transform: uppercase;
}

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-section-label {
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.15em;
    color: var(--grey-2);
    text-transform: uppercase;
    padding: 22px 12px 8px;
}
.nav-divider { display: none; }
.nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    color: var(--grey);
    font-size: 14.5px;
    font-weight: 500;
    text-align: left;
    transition: background 160ms ease-out, color 160ms ease-out;
    position: relative;
}
.nav a svg {
    width: 18px;
    height: 18px;
    stroke-width: 1.9;
    flex-shrink: 0;
    transition: transform 160ms ease-out;
}
.nav a:hover { background: var(--bg); color: var(--ink); }
.nav a:hover svg { transform: translateX(1px); }
.nav a.active {
    background: var(--light-red);
    color: var(--red-acc);
    font-weight: 600;
}
.nav a.active::before {
    content: "";
    position: absolute;
    left: -18px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 20px;
    border-radius: 0 4px 4px 0;
    background: var(--red-acc);
}
.nav a .nav-pill {
    margin-left: auto;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.08em;
    padding: 3px 7px;
    border-radius: 6px;
    background: var(--light-purple);
    color: var(--blue);
    text-transform: uppercase;
}
.nav a .nav-lock {
    margin-left: auto;
    opacity: 0.55;
    width: 14px;
    height: 14px;
}

.sidebar-footer {
    margin-top: auto;
    padding: 18px 12px 2px;
    font-size: 11.5px;
    color: var(--grey-2);
    line-height: 1.5;
    border-top: 1px solid var(--stroke);
}

/* IA badge — defined now so the Virtual DPO sub-project can drop it in. */
.badge-ia {
    margin-left: auto;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.1em;
    padding: 3px 8px;
    border-radius: 6px;
    background: var(--red-grad);
    color: #fff;
    text-transform: uppercase;
    box-shadow: 0 2px 6px -2px rgba(235, 20, 20, 0.6);
}

/* ---------- Topbar ------------------------------------------------------- */
.topbar {
    height: 64px;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 38px;
    background: rgba(245, 245, 245, 0.72);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--stroke);
    position: sticky;
    top: 0;
    z-index: 50;
}
.topbar-spacer { flex: 1; }

.lang-switch {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    margin: 0;
}
.lang-switch button {
    font-family: var(--sans);
    font-size: 12.5px;
    font-weight: 600;
    color: var(--grey-2);
    background: none;
    border: none;
    cursor: pointer;
    padding: 3px 7px;
    border-radius: 7px;
    transition: 150ms;
    line-height: 1;
}
.lang-switch button:hover { color: var(--ink); }
.lang-switch button.active {
    color: var(--ink);
    font-weight: 800;
    background: var(--bg);
}
.lang-switch .sep { color: var(--grey-2); font-size: 12px; }

.topbar-vbar { width: 1px; height: 26px; background: var(--stroke); }

.impersonate-return {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid #F59E0B;
    background: #FFF7E6;
    color: #B45309;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
}
.impersonate-return:hover { background: #FDE68A; }

.icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid var(--stroke);
    background: var(--white);
    display: grid;
    place-items: center;
    cursor: pointer;
    color: var(--grey);
    transition: 150ms;
    position: relative;
}
.icon-btn:hover {
    color: var(--red-acc);
    border-color: #F2C9C9;
    background: var(--light-red);
}
.icon-btn .dot {
    position: absolute;
    top: 8px; right: 9px;
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--red-acc);
    border: 2px solid var(--white);
}
.icon-btn svg { width: 17px; height: 17px; stroke-width: 2; }

.user-menu {
    display: flex;
    align-items: center;
    gap: 11px;
}
.user-menu .avatar {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    background: linear-gradient(135deg, #2A2C31, #161718);
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 13px;
    font-family: var(--display);
    box-shadow: var(--shadow-sm);
}
.user-menu .name { line-height: 1.25; }
.user-menu .name b {
    font-size: 13.5px;
    font-weight: 600;
    display: block;
    color: var(--ink);
}
.user-menu .name small { font-size: 11.5px; color: var(--grey-2); }
.user-menu form { margin: 0; }
.user-menu .logout-btn {
    background: transparent;
    border: none;
    color: var(--grey-2);
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    transition: 150ms;
}
.user-menu .logout-btn:hover { color: var(--red-acc); background: var(--light-red); }
.user-menu .logout-btn svg { width: 18px; height: 18px; stroke-width: 1.8; }

/* ---------- Page head ---------------------------------------------------- */
.page-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 26px;
    gap: 20px;
    flex-wrap: wrap;
}
.page-head .title-block h1 { margin-bottom: 7px; }
.page-head .title-block .sub {
    font-size: 14px;
    color: var(--grey-2);
    font-weight: 450;
}
.page-head .title-block .sub b { color: var(--grey); font-weight: 600; }
.page-head .actions {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-shrink: 0;
}

/* ---------- Cards -------------------------------------------------------- */
.card {
    background: var(--white);
    border: 1px solid var(--stroke);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}
.card + .card { margin-top: 18px; }
.card-title {
    font-family: var(--display);
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--ink);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.card-title .muted {
    color: var(--grey-2);
    font-weight: 500;
    font-size: 12.5px;
    font-family: var(--sans);
    letter-spacing: 0;
}

/* ---------- Buttons ------------------------------------------------------ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--sans);
    font-size: 13.5px;
    font-weight: 600;
    padding: 11px 18px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    border: 1px solid transparent;
    background: transparent;
    color: var(--ink);
    transition: 180ms;
    text-decoration: none;
    white-space: nowrap;
}
.btn svg { width: 16px; height: 16px; stroke-width: 2.1; }
.btn-primary {
    background: var(--red-grad);
    color: #fff;
    box-shadow: 0 6px 18px -6px rgba(235, 20, 20, 0.55);
}
.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px -8px rgba(235, 20, 20, 0.60);
    color: #fff;
}
.btn-secondary, .btn-ghost {
    background: var(--white);
    color: var(--ink);
    border-color: var(--stroke);
    box-shadow: var(--shadow-sm);
}
.btn-secondary:hover, .btn-ghost:hover {
    border-color: #D4D6DA;
    background: #FCFCFC;
}
.btn-disabled, .btn[disabled] {
    cursor: not-allowed;
    opacity: 0.55;
    pointer-events: none;
}
.btn-block { width: 100%; justify-content: center; padding: 13px 18px; }

/* ---------- Forms -------------------------------------------------------- */
.form-row { margin-bottom: 18px; }
.form-row label {
    display: block;
    font-size: 13px;
    color: var(--ink);
    margin-bottom: 6px;
    font-weight: 500;
}
.input,
input[type="text"], input[type="email"], input[type="password"], input[type="file"],
input[type="date"], input[type="datetime-local"], input[type="time"],
input[type="month"], input[type="week"],
input[type="number"], input[type="tel"], input[type="url"], input[type="search"],
select, textarea {
    width: 100%;
    background: var(--white);
    border: 1px solid var(--stroke);
    border-radius: var(--radius-sm);
    padding: 10px 13px;
    line-height: 1.4;
    font-size: 13.5px;
    color: var(--ink);
    font-family: inherit;
    transition: border-color 150ms ease-out, box-shadow 150ms ease-out;
    -webkit-appearance: none;
    appearance: none;
}
input[type="file"] { padding: 8px 10px; }
input[type="number"] { font-variant-numeric: tabular-nums; }

/* Native date/time inputs — normalise height and tidy the calendar icon */
input[type="date"],
input[type="datetime-local"],
input[type="time"],
input[type="month"],
input[type="week"] {
    min-height: 40px;
}
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator,
input[type="month"]::-webkit-calendar-picker-indicator,
input[type="week"]::-webkit-calendar-picker-indicator {
    opacity: 0.55;
    cursor: pointer;
    padding: 2px;
    border-radius: 6px;
    transition: opacity 150ms ease-out, background 150ms ease-out;
}
input[type="date"]::-webkit-calendar-picker-indicator:hover,
input[type="datetime-local"]::-webkit-calendar-picker-indicator:hover,
input[type="time"]::-webkit-calendar-picker-indicator:hover,
input[type="month"]::-webkit-calendar-picker-indicator:hover,
input[type="week"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
    background: var(--light-red);
}

/* Number spin buttons — strip the dated browser chrome */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
}
input[type="number"] { -moz-appearance: textfield; }

/* Select chevron (we stripped the native appearance above) */
select {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'><path d='M1 1.5L6 6.5L11 1.5' stroke='%2394969E' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/></svg>");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 38px;
}

.input:focus,
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--red);
    box-shadow: 0 0 0 3px rgba(253, 29, 29, 0.12);
}
input::placeholder, textarea::placeholder { color: var(--grey-2); }
input:disabled, select:disabled, textarea:disabled {
    background: var(--bg);
    color: var(--grey-2);
    cursor: not-allowed;
}
.field-error { color: var(--red-acc); font-size: 12px; margin-top: 4px; }
.form-actions { display: flex; gap: 8px; margin-top: 24px; }
.help { color: var(--grey-2); font-size: 12px; margin-top: 6px; }

/* ---------- Pills / tags / badges --------------------------------------- */
.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    font-weight: 600;
    padding: 5px 11px;
    border-radius: 8px;
    white-space: nowrap;
    border: 1px solid transparent;
}
.pill::before {
    content: "";
    width: 6px; height: 6px;
    border-radius: 50%;
    background: currentColor;
}
.pill-new        { background: var(--blue-bg);   color: var(--blue);    border-color: var(--blue-bd); }
.pill-in_progress{ background: var(--amber-bg);  color: var(--amber);   border-color: var(--amber-bd); }
.pill-answered   { background: var(--green-bg);  color: var(--green);   border-color: var(--green-bd); }
.pill-closed     { background: var(--slate-bg);  color: var(--slate);   border-color: var(--slate-bd); }
.pill-active     { background: var(--green-bg);  color: var(--green);   border-color: var(--green-bd); }
.pill-must       { background: var(--light-red); color: var(--red-acc); border-color: #F4D2D2; }
.pill-should     { background: var(--amber-bg);  color: var(--amber);   border-color: var(--amber-bd); }
.pill-nice       { background: var(--blue-bg);   color: var(--blue);    border-color: var(--blue-bd); }
.pill-ra         { background: var(--light-red); color: var(--red-acc); border-color: #F4D2D2; }
.pill-client     { background: var(--slate-bg);  color: var(--slate);   border-color: var(--slate-bd); }
/* "Soon" pill in tables/cards (sidebar uses .nav-pill instead) */
.pill-soon       { background: var(--light-purple); color: var(--blue); border-color: var(--blue-bd); }

/* Same-shape decorative tag used on dashboard headers */
.tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 5px 10px;
    border-radius: 7px;
}

/* ---------- Tables ------------------------------------------------------- */
.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
}
.table thead th {
    background: var(--light-red);
    color: var(--red-acc);
    font-weight: 700;
    text-align: left;
    padding: 15px 20px;
    font-size: 10.5px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    border-bottom: 1px solid #F4D9D9;
}
.table thead th.r { text-align: right; }
.table tbody td {
    padding: 16px 20px;
    border-bottom: 1px solid #F1F2F3;
    font-size: 13.5px;
    color: var(--grey);
    vertical-align: middle;
}
.table tbody td.r { text-align: right; font-variant-numeric: tabular-nums; }
.table tbody tr { transition: background 140ms ease-out; }
.table tbody tr:hover { background: #FBFBFC; }
.table tbody tr:last-child td { border-bottom: none; }
.table-card {
    background: var(--white);
    border: 1px solid var(--stroke);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

/* ---------- KPI grid (legacy port — to be redesigned in #3) ------------- */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    margin-bottom: 18px;
}
.kpi {
    background: var(--white);
    border: 1px solid var(--stroke);
    border-radius: var(--radius);
    padding: 20px 20px 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: var(--shadow-sm);
    transition: transform 200ms, box-shadow 200ms, border-color 200ms;
    text-decoration: none;
    color: inherit;
}
a.kpi:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: #DADCE0;
}
.kpi .label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.11em;
    text-transform: uppercase;
    color: var(--grey-2);
}
.kpi .value {
    font-family: var(--display);
    font-size: 38px;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1;
    color: var(--ink);
    margin: 6px 0 4px;
}
.kpi .value.urgent { color: var(--red-acc); }
.kpi .meta { font-size: 12.5px; color: var(--grey-2); font-weight: 500; }
.kpi .meta.positive { color: var(--green); font-weight: 600; }

/* ---------- Progress bar ------------------------------------------------- */
.progress {
    background: #EFE7E7;
    height: 7px;
    border-radius: 99px;
    overflow: hidden;
    margin-top: 6px;
}
.progress .bar {
    height: 100%;
    background: var(--red-grad);
    border-radius: 99px;
    transition: width 200ms ease-out;
}
.progress .bar.warning { background: var(--amber); }
.progress .bar.critical { background: var(--red-acc); }

/* ---------- Dashboard 2-col --------------------------------------------- */
.dashboard-grid {
    display: grid;
    grid-template-columns: 60fr 40fr;
    gap: 18px;
}

/* ---------- Activity list ------------------------------------------------ */
.activity { display: flex; flex-direction: column; }
.activity-item {
    display: flex;
    gap: 13px;
    align-items: center;
    padding: 13px 0;
    border-bottom: 1px solid #F0F1F2;
    color: var(--ink);
    transition: background 140ms ease-out;
}
.activity-item:last-child { border-bottom: none; }
.activity-item:hover { background: #FBFBFC; }
.activity-item .icon {
    width: 34px; height: 34px;
    border-radius: 10px;
    background: var(--light-red);
    color: var(--red-acc);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.activity-item .icon svg { width: 16px; height: 16px; stroke-width: 2; }
.activity-item .text { flex: 1; font-size: 13.5px; color: var(--ink); }
.activity-item .ts {
    font-size: 11.5px;
    color: var(--grey-2);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* ---------- Login page --------------------------------------------------- */
.login-page {
    min-height: 100vh;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.login-card {
    background: var(--white);
    border: 1px solid var(--stroke);
    border-radius: var(--radius);
    max-width: 420px;
    width: 100%;
    padding: 36px;
    box-shadow: var(--shadow-md);
}
.login-brand {
    display: flex;
    align-items: center;
    gap: 11px;
    margin-bottom: 26px;
}
.login-brand .mark { width: 40px; height: 40px; display: grid; place-items: center; }
.login-brand .mark img {
    width: 40px; height: 40px;
    filter: drop-shadow(0 5px 12px rgba(253, 0, 36, 0.30));
}
.login-brand .name {
    font-family: var(--display);
    font-weight: 700;
    font-size: 17px;
    color: var(--red-acc);
    letter-spacing: -0.02em;
    line-height: 1;
}
.login-brand .sub {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.16em;
    color: var(--grey-2);
    text-transform: uppercase;
    margin-top: 4px;
}
.login-title { font-size: 22px; margin-bottom: 6px; }
.login-sub { color: var(--grey-2); font-size: 14px; margin-bottom: 24px; }
.login-demo-banner {
    background: var(--bg);
    border: 1px solid var(--stroke);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    font-size: 12px;
    color: var(--grey);
    margin-bottom: 24px;
    line-height: 1.5;
}
.login-demo-banner strong { color: var(--ink); }
.login-demo-banner code {
    background: var(--white);
    border: 1px solid var(--stroke);
    border-radius: 4px;
    padding: 1px 5px;
    font-size: 11px;
    color: var(--ink);
    font-family: ui-monospace, monospace;
}

/* ---------- Empty state -------------------------------------------------- */
.empty-state { text-align: center; padding: 48px 24px; }
.empty-state .icon-wrap {
    width: 40px; height: 40px;
    margin: 0 auto 12px;
    color: var(--grey-2);
}
.empty-state .icon-wrap svg { width: 40px; height: 40px; stroke-width: 1.4; }
.empty-state h3 { font-size: 16px; margin-bottom: 6px; }
.empty-state p { color: var(--grey-2); font-size: 14px; margin: 0 0 16px; }

/* ---------- Filters bar -------------------------------------------------- */
.filters {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--white);
    border: 1px solid var(--stroke);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 18px;
    flex-wrap: wrap;
    box-shadow: var(--shadow-sm);
}
.filters select,
.filters input[type="text"],
.filters input[type="date"],
.filters input[type="number"],
.filters input[type="search"] {
    height: 38px;
    padding: 8px 13px;
    font-size: 13.5px;
    width: auto;
    min-width: 160px;
}
.filters select { padding-right: 36px; }
.filters .filter-label {
    font-size: 11px;
    color: var(--grey-2);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 700;
}

/* ---------- Tabs --------------------------------------------------------- */
.tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--stroke);
    margin-bottom: 16px;
}
.tabs a {
    padding: 10px 14px;
    font-size: 13px;
    color: var(--grey-2);
    border-bottom: 2px solid transparent;
    transition: 150ms;
    margin-bottom: -1px;
}
.tabs a:hover { color: var(--ink); }
.tabs a.active {
    color: var(--red-acc);
    border-bottom-color: var(--red-acc);
    font-weight: 600;
}

/* ---------- Demand detail ----------------------------------------------- */
.detail-meta { color: var(--grey-2); font-size: 13px; margin: 8px 0 24px; }
.detail-meta span + span::before { content: "·"; margin: 0 8px; color: var(--stroke); }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.detail-grid .card h3 { margin-bottom: 8px; font-size: 14px; }
.notice {
    background: var(--amber-bg);
    border: 1px solid var(--amber-bd);
    color: var(--amber);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    margin-bottom: 16px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.notice svg { width: 18px; height: 18px; stroke-width: 1.8; flex-shrink: 0; }

/* ---------- Documents grid (legacy port) -------------------------------- */
.doc-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}
.doc-card {
    background: var(--white);
    border: 1px solid var(--stroke);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: var(--shadow-sm);
    transition: 200ms;
}
.doc-card:hover {
    border-color: #DADCE0;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.doc-card .doc-icon {
    width: 42px; height: 42px;
    border-radius: 11px;
    background: var(--light-red);
    color: var(--red-acc);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
}
.doc-card .doc-icon svg { width: 20px; height: 20px; stroke-width: 1.8; }
.doc-card .doc-title { font-size: 14px; font-weight: 600; color: var(--ink); }
.doc-card .doc-meta {
    font-size: 12px;
    color: var(--grey-2);
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.doc-card .doc-actions { margin-top: 8px; display: flex; gap: 8px; }

/* ---------- Action plan (legacy port — kanban arrives in #5) ----------- */
.priority-group { margin-bottom: 26px; }
.priority-group-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 13px;
    font-size: 11px;
    color: var(--grey-2);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
}
.action-row {
    background: var(--white);
    border: 1px solid var(--stroke);
    border-radius: var(--radius-sm);
    padding: 18px 20px;
    margin-bottom: 11px;
    transition: 180ms;
    box-shadow: var(--shadow-sm);
}
.action-row:hover { border-color: #DADCE0; box-shadow: var(--shadow-md); }
.action-row-head {
    display: grid;
    grid-template-columns: auto 1fr 140px 160px 80px;
    gap: 14px;
    align-items: center;
}
.action-row .a-title { font-weight: 600; font-size: 14.5px; color: var(--ink); }
.action-row .a-desc { color: var(--grey-2); font-size: 13px; margin-top: 4px; line-height: 1.55; }
.action-row .a-due { font-size: 12.5px; color: var(--grey-2); font-weight: 500; }
.action-row .a-due.overdue { color: var(--red-acc); font-weight: 700; }
.action-row form { display: contents; }
.action-row .a-expand {
    background: transparent;
    border: none;
    color: var(--red-acc);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    padding: 4px 8px;
}
.action-row .a-expand:hover { text-decoration: underline; }
.action-row-body {
    display: none;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--stroke);
}
.action-row-body.open { display: block; }
.action-row-body .origin { color: var(--grey-2); font-size: 12px; margin-top: 8px; }

/* ---------- Placeholder pages ------------------------------------------- */
.placeholder-block {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    background: var(--white);
    border: 1px solid var(--stroke);
    border-radius: var(--radius);
    padding: 32px;
    box-shadow: var(--shadow-sm);
    align-items: center;
}
.placeholder-block .desc p {
    color: var(--ink);
    margin: 0 0 16px;
    font-size: 15px;
    line-height: 1.6;
}
.placeholder-block .desc ul {
    margin: 16px 0 24px;
    padding-left: 18px;
    color: var(--grey);
}
.placeholder-block .desc ul li { margin-bottom: 6px; font-size: 14px; }
.placeholder-block .desc ul li::marker { color: var(--red-acc); }
.placeholder-block .desc h3 {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--grey-2);
    margin-top: 8px;
    margin-bottom: 8px;
    font-weight: 700;
    font-family: var(--sans);
}
.placeholder-illu {
    width: 100%;
    aspect-ratio: 5/4;
    background: var(--bg);
    border: 1px dashed var(--stroke);
    border-radius: var(--radius);
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.placeholder-illu svg { width: 100%; height: 100%; }

.locked-banner {
    background: var(--light-red);
    border: 1px solid #F4C9C9;
    color: var(--red-acc);
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 13px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.locked-banner svg { width: 18px; height: 18px; }

/* ---------- Messages (toasts) ------------------------------------------- */
.messages {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: min(420px, calc(100vw - 48px));
    pointer-events: none;
}
.messages .msg {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: #F4F6F8;
    color: var(--ink);
    border: 1px solid #E4E7EB;
    border-left: 3px solid #94A3B8;
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    font-size: 13.5px;
    line-height: 1.5;
    box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.18), 0 4px 10px -2px rgba(15, 23, 42, 0.08);
    pointer-events: auto;
    animation: msg-slide-in 220ms cubic-bezier(0.22, 1, 0.36, 1);
}
.messages .msg.is-leaving {
    animation: msg-slide-out 260ms ease forwards;
}
@keyframes msg-slide-in {
    from { opacity: 0; transform: translateX(24px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes msg-slide-out {
    to { opacity: 0; transform: translateX(24px); }
}
@media (prefers-reduced-motion: reduce) {
    .messages .msg, .messages .msg.is-leaving { animation: none; }
}
.messages .msg .msg-icon {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    margin-top: 1px;
}
.messages .msg.success {
    background: #ECFDF5;
    color: #065F46;
    border-color: #A7F3D0;
    border-left-color: #10B981;
}
.messages .msg.success .msg-icon { color: #10B981; }
.messages .msg.error {
    background: #FEF2F2;
    color: #991B1B;
    border-color: #FECACA;
    border-left-color: #DC2626;
}
.messages .msg.error .msg-icon { color: #DC2626; }
.messages .msg.warning {
    background: #FFFBEB;
    color: #92400E;
    border-color: #FDE68A;
    border-left-color: #F59E0B;
}
.messages .msg.warning .msg-icon { color: #F59E0B; }
.messages .msg.info {
    background: #EFF6FF;
    color: #1E40AF;
    border-color: #BFDBFE;
    border-left-color: #2563EB;
}
.messages .msg.info .msg-icon { color: #2563EB; }

/* ---------- Annual report (legacy port — magazine arrives in #6) ------ */
.report h2 {
    margin-top: 32px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--stroke);
}
.report .lead { font-size: 16px; color: var(--ink); line-height: 1.6; }
.report .summary-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin: 16px 0 24px;
}
.report .stat {
    background: var(--white);
    border: 1px solid var(--stroke);
    border-radius: var(--radius-sm);
    padding: 16px;
}
.report .stat .label {
    color: var(--grey-2);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
}
.report .stat .value {
    font-family: var(--display);
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-top: 6px;
    font-variant-numeric: tabular-nums;
}

/* ---------- DPO impersonation chip (topbar) ------------------------------ */
.topbar-spacer { display: flex; align-items: center; }
.impersonate-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 6px 5px 12px;
    background: #ECFDF5;
    border: 1px solid #A7F3D0;
    border-radius: 999px;
    color: #047857;
    font-size: 12.5px;
    font-weight: 500;
    line-height: 1;
    box-shadow: var(--shadow-sm);
}
.impersonate-chip svg { stroke-width: 2; flex-shrink: 0; }
.impersonate-chip .ic-label {
    color: var(--grey);
    font-weight: 500;
    font-size: 12px;
    letter-spacing: 0.01em;
}
.impersonate-chip b {
    color: var(--ink);
    font-weight: 700;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.impersonate-chip form { margin: 0; }
.impersonate-chip form button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 999px;
    border: none;
    background: var(--white);
    color: #047857;
    cursor: pointer;
    transition: background 140ms ease-out, color 140ms ease-out;
}
.impersonate-chip form button:hover { background: #047857; color: var(--white); }

/* ---------- Modal -------------------------------------------------------- */
.modal-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(7, 9, 22, 0.32);
    z-index: 50;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.modal-backdrop.open { display: flex; }
.modal {
    background: var(--white);
    border-radius: var(--radius);
    max-width: 480px;
    width: 100%;
    border: 1px solid var(--stroke);
    padding: 24px;
    box-shadow: var(--shadow-lg);
}
.modal h2 { margin-bottom: 16px; }

/* ---------- Utilities ---------------------------------------------------- */
.text-muted { color: var(--grey-2); }
.text-small { font-size: 13px; }
.text-tiny  { font-size: 12px; }
.text-right { text-align: right; }
.row-gap-2  { row-gap: 8px; }
.gap-1      { gap: 8px; }
.flex          { display: flex; align-items: center; }
.flex-between  { display: flex; align-items: center; justify-content: space-between; }
.flex-end      { display: flex; align-items: center; justify-content: flex-end; }
.mt-1 { margin-top: 8px; }  .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; } .mb-4 { margin-bottom: 32px; }
.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
    display: block;
}

/* ---------- Responsive --------------------------------------------------- */
@media (max-width: 1024px) {
    .kpi-grid { grid-template-columns: repeat(2, 1fr); }
    .dashboard-grid { grid-template-columns: 1fr; }
    .doc-grid { grid-template-columns: repeat(2, 1fr); }
    .placeholder-block { grid-template-columns: 1fr; }
    .detail-grid { grid-template-columns: 1fr; }
    .action-row-head { grid-template-columns: auto 1fr auto; }
    .action-row-head .a-due, .action-row-head .a-status { display: none; }
}
@media (max-width: 768px) {
    .app { grid-template-columns: 1fr; }
    .sidebar { display: none; }
    .content { padding: 16px; }
    .topbar { padding: 0 16px; }
    .kpi-grid { grid-template-columns: 1fr; }
    .doc-grid { grid-template-columns: 1fr; }
    .report .summary-grid { grid-template-columns: repeat(2, 1fr); }
}


/* ========================================================================
   Virtual DPO — chat page + floating launcher
   ======================================================================== */

/* ---------- Chat card shell -------------------------------------------- */
.chat-card {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 228px);
    min-height: 500px;
    overflow: hidden;
    padding: 0;
    background: var(--white);
    border: 1px solid var(--stroke);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.chat-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 22px;
    border-bottom: 1px solid var(--stroke);
}
.chat-top-l { display: flex; align-items: center; gap: 12px; }
.chat-top .chat-ava {
    width: 40px; height: 40px;
    border-radius: 11px;
    background: var(--red-grad);
    display: grid; place-items: center;
    box-shadow: 0 5px 14px -5px rgba(235, 20, 20, 0.55);
    flex-shrink: 0;
    color: #fff;
}
.chat-top .chat-ava svg { width: 21px; height: 21px; }
.chat-name {
    font-family: var(--display);
    font-size: 15px;
    font-weight: 700;
    color: var(--ink);
    letter-spacing: -0.01em;
}
.chat-status {
    font-size: 11.5px;
    color: var(--grey-2);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 1px;
}
.chat-status .online {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: #22B07D;
    box-shadow: 0 0 0 3px rgba(34, 176, 125, 0.16);
}
.chat-new {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-family: var(--sans);
    font-size: 12.5px;
    font-weight: 600;
    color: var(--grey);
    background: var(--white);
    border: 1px solid var(--stroke);
    border-radius: 9px;
    padding: 8px 12px;
    cursor: pointer;
    transition: 150ms;
    white-space: nowrap;
}
.chat-new:hover { border-color: #F2C9C9; color: var(--red-acc); background: var(--light-red); }
.chat-new svg { width: 14px; height: 14px; }

.chat-disclaimer {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 24px;
    background: var(--light-red);
    border-bottom: 1px solid #F4D9D9;
    font-size: 12.5px;
    color: var(--red-acc);
    line-height: 1.45;
}
.chat-disclaimer svg { width: 17px; height: 17px; flex-shrink: 0; }
.chat-disclaimer b { font-weight: 700; }

/* ---------- Message stream -------------------------------------------- */
.chat-stream {
    flex: 1;
    overflow-y: auto;
    padding: 26px 26px 10px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    scroll-behavior: smooth;
}

.msg {
    display: flex;
    flex-direction: column;
    gap: 7px;
    max-width: 600px;
    animation: msgRise 0.35s ease both;
}
.msg.me { margin-left: auto; align-items: flex-end; }
.msg.ai { margin-right: auto; align-items: flex-start; }
.msg-label {
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--grey-2);
    padding: 0 5px;
}

.bubble {
    font-size: 14px;
    line-height: 1.62;
    color: var(--ink);
}
.bubble p { margin: 0 0 9px; }
.bubble p:last-child { margin: 0; }
.bubble strong { font-weight: 700; }
.bubble h4 {
    font-family: var(--display);
    font-size: 14.5px;
    margin: 10px 0 6px;
    font-weight: 600;
}
.bubble ul { margin: 5px 0 9px; padding-left: 19px; }
.bubble li { margin: 4px 0; }
.bubble code {
    background: var(--bg);
    border: 1px solid var(--stroke);
    border-radius: 5px;
    padding: 1px 6px;
    font-size: 12.5px;
    font-family: ui-monospace, monospace;
}

.msg.ai .bubble {
    background: var(--red-pure);
    color: #fff;
    border: none;
    border-radius: 16px;
    padding: 15px 18px;
    box-shadow: 0 12px 30px -12px rgba(253, 0, 36, 0.5);
}
.msg.ai .bubble strong { color: #fff; font-weight: 800; }
.msg.ai .bubble h4 { color: #fff; }
.msg.ai .bubble a { color: #fff; text-decoration: underline; }
.msg.ai .bubble code {
    background: rgba(255, 255, 255, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.34);
    color: #fff;
}

.msg.me .bubble {
    background: var(--ink);
    color: #fff;
    border-radius: 16px;
    padding: 13px 17px;
}
.msg.me .bubble code {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.msg-cta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 11px;
}
.cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-family: var(--sans);
    font-size: 12.5px;
    font-weight: 700;
    color: #fff;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.34);
    border-radius: 9px;
    padding: 8px 13px;
    cursor: pointer;
    transition: 150ms;
}
.cta-btn:hover { background: rgba(255, 255, 255, 0.3); }
.cta-btn svg { width: 14px; height: 14px; }

.msg-actions { display: flex; gap: 6px; margin-top: 8px; }
.msg-act {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-family: var(--sans);
    font-size: 11px;
    font-weight: 600;
    color: var(--grey-2);
    background: none;
    border: 1px solid var(--stroke);
    border-radius: 7px;
    padding: 4px 9px;
    cursor: pointer;
    transition: 150ms;
}
.msg-act:hover {
    color: var(--red-acc);
    border-color: #F2C9C9;
    background: var(--light-red);
}
.msg-act svg { width: 12px; height: 12px; }

.typing { display: flex; gap: 5px; padding: 3px 2px; }
.typing span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    animation: typingBlink 1.2s infinite;
}
.typing span:nth-child(2) { animation-delay: 0.2s; }
.typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes msgRise {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: none; }
}
@keyframes typingBlink {
    0%, 60%, 100% { opacity: 0.25; transform: translateY(0); }
    30%           { opacity: 1;    transform: translateY(-3px); }
}

/* ---------- Welcome state --------------------------------------------- */
.chat-welcome {
    padding: 34px 26px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}
.cw-mark {
    width: 54px; height: 54px;
    border-radius: 15px;
    background: var(--red-grad);
    display: grid; place-items: center;
    box-shadow: 0 8px 22px -6px rgba(235, 20, 20, 0.5);
    margin-bottom: 17px;
    color: #fff;
}
.cw-mark svg { width: 28px; height: 28px; }
.chat-welcome h3 {
    font-family: var(--display);
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: 9px;
}
.chat-welcome > p {
    font-size: 14px;
    color: var(--grey);
    line-height: 1.62;
    max-width: 600px;
}

.cap-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 11px;
    width: 100%;
    max-width: 660px;
    margin-top: 24px;
}
.cap-card {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    text-align: left;
    background: var(--white);
    border: 1px solid var(--stroke);
    border-radius: 13px;
    padding: 13px 14px;
    cursor: pointer;
    transition: 160ms;
    box-shadow: var(--shadow-sm);
    font-family: var(--sans);
}
.cap-card:hover {
    border-color: #F2C9C9;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.cap-ico {
    width: 34px; height: 34px;
    border-radius: 9px;
    background: var(--light-red);
    color: var(--red-acc);
    display: grid; place-items: center;
    flex-shrink: 0;
}
.cap-ico svg { width: 18px; height: 18px; stroke-width: 1.9; }
.cap-card .ct {
    font-size: 13px;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 3px;
    letter-spacing: -0.005em;
}
.cap-card .cq {
    font-size: 11.5px;
    color: var(--grey-2);
    line-height: 1.45;
}

/* ---------- Quick chips + follow-ups ---------------------------------- */
.quick-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding: 13px 22px 0;
}
.qchip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-family: var(--sans);
    font-size: 12px;
    font-weight: 600;
    color: var(--grey);
    background: var(--bg);
    border: 1px solid var(--stroke);
    border-radius: 99px;
    padding: 7px 13px;
    cursor: pointer;
    transition: 150ms;
}
.qchip:hover { border-color: #F2C9C9; color: var(--red-acc); background: var(--light-red); }
.qchip svg { width: 13px; height: 13px; }

.followups {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 7px;
    margin: 12px 0 2px;
    padding-left: 5px;
}
.fu-label {
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--grey-2);
}
.fchip {
    font-family: var(--sans);
    font-size: 12.5px;
    font-weight: 500;
    color: var(--ink);
    background: var(--white);
    border: 1px solid var(--stroke);
    border-radius: 10px;
    padding: 8px 13px;
    cursor: pointer;
    transition: 150ms;
    text-align: left;
    line-height: 1.35;
}
.fchip:hover { border-color: #F2C9C9; color: var(--red-acc); background: var(--light-red); }
.fchip::before {
    content: "↗";
    color: var(--red-acc);
    font-weight: 700;
    margin-right: 7px;
}

/* ---------- Composer --------------------------------------------------- */
.composer {
    border-top: 1px solid var(--stroke);
    padding: 16px 22px;
    background: #FCFCFC;
}
.composer-inner {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    background: var(--white);
    border: 1px solid var(--stroke);
    border-radius: 14px;
    padding: 7px 7px 7px 16px;
    transition: 150ms;
}
.composer-inner:focus-within {
    border-color: var(--red);
    box-shadow: 0 0 0 3px rgba(253, 29, 29, 0.10);
}
.composer textarea {
    flex: 1;
    border: none;
    outline: none;
    resize: none;
    font-family: var(--sans);
    font-size: 14px;
    line-height: 1.5;
    color: var(--ink);
    background: none;
    max-height: 140px;
    padding: 9px 0;
}
.send-btn {
    width: 42px; height: 42px;
    border-radius: 11px;
    border: none;
    background: var(--red-grad);
    color: #fff;
    display: grid;
    place-items: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: 180ms;
    box-shadow: 0 4px 12px -4px rgba(235, 20, 20, 0.55);
}
.send-btn:hover { transform: translateY(-1px); }
.send-btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.send-btn svg { width: 18px; height: 18px; }
.composer .hint {
    font-size: 11px;
    color: var(--grey-2);
    text-align: center;
    margin-top: 9px;
}

/* ---------- Floating DPO launcher (FAB) ------------------------------- */
.dpo-fab {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 200;
    font-family: var(--sans);
}
.dpo-fab.hide { display: none; }

.dpo-bubble {
    display: grid;
    place-items: center;
    width: 58px; height: 58px;
    border-radius: 50%;
    background: var(--red-grad);
    border: none;
    cursor: pointer;
    box-shadow: 0 12px 30px -8px rgba(235, 20, 20, 0.6);
    position: relative;
    color: #fff;
    transition: 200ms;
}
.dpo-bubble:hover { transform: translateY(-2px) scale(1.04); }
.dpo-bubble svg { width: 27px; height: 27px; }
.dpo-bubble-badge {
    position: absolute;
    top: -3px;
    right: -3px;
    background: var(--ink);
    color: #fff;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.05em;
    padding: 2px 5px;
    border-radius: 99px;
    border: 2px solid var(--bg);
}
.dpo-fab.min .dpo-bubble { display: grid; }
.dpo-fab.min .dpo-panel { display: none; }
.dpo-fab:not(.min) .dpo-bubble { display: none; }

.dpo-panel {
    width: 316px;
    background: rgba(255, 255, 255, 0.92);
    -webkit-backdrop-filter: blur(22px) saturate(1.6);
    backdrop-filter: blur(22px) saturate(1.6);
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: 16px;
    box-shadow:
        0 22px 54px -16px rgba(7, 9, 22, 0.28),
        0 6px 16px -8px rgba(7, 9, 22, 0.12);
    overflow: hidden;
    animation: dpoIn 0.22s ease both;
}
@keyframes dpoIn {
    from { opacity: 0; transform: translateY(12px) scale(0.98); }
    to   { opacity: 1; transform: none; }
}
.dpo-phead {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 13px 14px;
    background: linear-gradient(180deg, rgba(255, 246, 246, 0.2) 0%, rgba(255, 255, 255, 0) 100%);
    border-bottom: 1px solid rgba(228, 230, 231, 0.55);
}
.dpo-phead-l {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    min-width: 0;
}
.dpo-pava {
    width: 36px; height: 36px;
    border-radius: 10px;
    background: var(--red-grad);
    display: grid; place-items: center;
    box-shadow: 0 4px 12px -4px rgba(235, 20, 20, 0.5);
    flex-shrink: 0;
    color: #fff;
}
.dpo-pava svg { width: 19px; height: 19px; }
.dpo-pname {
    font-family: var(--display);
    font-size: 14px;
    font-weight: 700;
    color: var(--ink);
    display: flex;
    align-items: center;
    gap: 6px;
    letter-spacing: -0.01em;
}
.dpo-ia {
    font-size: 8.5px;
    font-weight: 800;
    letter-spacing: 0.05em;
    color: var(--red-acc);
    background: var(--light-red);
    border: 1px solid #F4D9D9;
    padding: 1px 5px;
    border-radius: 99px;
}
.dpo-pstat {
    font-size: 11px;
    color: var(--grey-2);
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 2px;
}
.dpo-pstat .online {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: #22B07D;
    box-shadow: 0 0 0 3px rgba(34, 176, 125, 0.16);
}
.dpo-min {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--grey-2);
    width: 26px; height: 26px;
    border-radius: 7px;
    display: grid; place-items: center;
    flex-shrink: 0;
    transition: 150ms;
}
.dpo-min:hover { background: rgba(7, 9, 22, 0.05); color: var(--ink); }
.dpo-min svg { width: 16px; height: 16px; }

.dpo-sugs {
    display: flex;
    flex-direction: column;
    gap: 7px;
    padding: 13px 13px 6px;
}
.dpo-sug {
    display: flex;
    align-items: center;
    gap: 9px;
    text-align: left;
    font-family: var(--sans);
    font-size: 12.5px;
    font-weight: 500;
    color: var(--ink);
    background: var(--bg);
    border: 1px solid var(--stroke);
    border-radius: 10px;
    padding: 10px 11px;
    cursor: pointer;
    transition: 150ms;
    line-height: 1.3;
}
.dpo-sug:hover {
    border-color: #F2C9C9;
    color: var(--red-acc);
    background: var(--light-red);
    transform: translateX(2px);
}
.dpo-sug svg { width: 15px; height: 15px; flex-shrink: 0; color: var(--red-acc); }

.dpo-compose {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 8px 13px 14px;
}
.dpo-finput {
    flex: 1;
    min-width: 0;
    font-family: var(--sans);
    font-size: 12.5px;
    color: var(--ink);
    background: var(--bg);
    border: 1px solid var(--stroke);
    border-radius: 10px;
    padding: 10px 12px;
    outline: none;
    transition: 150ms;
}
.dpo-finput::placeholder { color: var(--grey-2); }
.dpo-finput:focus {
    border-color: #F2C9C9;
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(253, 29, 29, 0.10);
}
.dpo-fsend {
    width: 38px; height: 38px;
    flex-shrink: 0;
    border-radius: 10px;
    border: none;
    background: var(--red-grad);
    color: #fff;
    display: grid;
    place-items: center;
    cursor: pointer;
    box-shadow: 0 4px 12px -4px rgba(235, 20, 20, 0.55);
    transition: 150ms;
}
.dpo-fsend:hover { transform: translateY(-1px); filter: brightness(1.05); }
.dpo-fsend svg { width: 17px; height: 17px; }

@media (max-width: 760px) {
    .cap-grid { grid-template-columns: 1fr; }
    .chat-new span { display: none; }
}
@media (max-width: 560px) {
    .dpo-panel { width: min(82vw, 300px); }
    .dpo-fab { right: 16px; bottom: 16px; }
}


/* ========================================================================
   Dashboard — KPI cards, charts, gauges, donut, plan, deadlines, timeline
   ======================================================================== */

/* Page-head extras */
.datepill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--grey);
    background: var(--white);
    border: 1px solid var(--stroke);
    border-radius: 11px;
    padding: 10px 14px;
    box-shadow: var(--shadow-sm);
}
.datepill svg { width: 15px; height: 15px; color: var(--red-acc); }

/* KPI grid */
.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    margin-bottom: 18px;
}
.stat {
    background: var(--white);
    border: 1px solid var(--stroke);
    border-radius: var(--radius);
    padding: 20px 20px 18px;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
    transition: transform 200ms, box-shadow 200ms, border-color 200ms;
    text-decoration: none;
    color: inherit;
    display: block;
}
.stat:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: #DADCE0;
}
.stat .lab {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.11em;
    text-transform: uppercase;
    color: var(--grey-2);
    display: flex;
    align-items: center;
    gap: 8px;
}
.stat .lab svg { width: 15px; height: 15px; stroke-width: 1.9; }
.stat .val {
    font-family: var(--display);
    font-size: 38px;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1;
    margin: 14px 0 8px;
    color: var(--ink);
}
.stat .val .u {
    font-size: 18px;
    color: var(--grey-2);
    font-weight: 500;
    letter-spacing: 0;
}
.stat .meta { font-size: 12.5px; color: var(--grey-2); font-weight: 500; }
.stat .meta.up { color: var(--green); font-weight: 600; }
.stat.feature { background: var(--red-soft-grad); }
.stat.feature::after {
    content: "";
    position: absolute;
    right: -30px; top: -30px;
    width: 120px; height: 120px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(253, 29, 29, 0.10), transparent 70%);
}
.stat .date {
    font-family: var(--display);
    font-size: 21px;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 13px 0 7px;
    color: var(--ink);
}
.sparkline {
    position: absolute;
    right: 14px;
    bottom: 14px;
    opacity: 0.9;
}
/* Override generic .progress in KPI feature card */
.stat .progress {
    height: 7px;
    border-radius: 99px;
    background: #EFE7E7;
    overflow: hidden;
    margin: 6px 0 9px;
}
.stat .progress i {
    display: block;
    height: 100%;
    border-radius: 99px;
    background: var(--red-grad);
}

/* Two- and three-column grids */
.grid-2 {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 18px;
    align-items: stretch;
    margin-bottom: 18px;
}
.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    align-items: stretch;
    margin-bottom: 18px;
}
.grid-2 > .card + .card,
.grid-3 > .card + .card { margin-top: 0; }

/* Panel head + link-more */
.panel { padding: 24px; }
.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.panel-head h2 {
    font-family: var(--display);
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.02em;
}
.panel-head .note {
    font-size: 12.5px;
    color: var(--grey-2);
    font-weight: 500;
}
.link-more {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--red-acc);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.link-more:hover { gap: 8px; transition: gap 0.15s; }

/* Bar chart */
.chart {
    margin-top: 18px;
    position: relative;
    height: 200px;
    padding-left: 30px;
}
.chart .ygrid {
    position: absolute;
    left: 0; right: 0; top: 0; bottom: 24px;
}
.chart .gl {
    position: absolute;
    left: 30px; right: 0;
    border-top: 1px dashed #EDEEF0;
    font-size: 10px;
    color: var(--grey-2);
}
.chart .gl span {
    position: absolute;
    left: -30px; top: -7px;
    width: 26px;
    text-align: right;
}
.bars {
    position: absolute;
    left: 30px; right: 0; top: 0; bottom: 24px;
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    gap: 8px;
    z-index: 2;
}
.bar {
    flex: 1;
    max-width: 46px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    height: 100%;
}
.bar .col {
    width: 100%;
    border-radius: 8px 8px 3px 3px;
    background: var(--red-grad);
    position: relative;
    transition: height 0.8s cubic-bezier(0.22, 0.61, 0.36, 1);
    box-shadow: 0 4px 10px -4px rgba(235, 20, 20, 0.45);
}
.bar .col.muted {
    background: linear-gradient(180deg, #F2D9D9, #EAC8C8);
    box-shadow: none;
}
.bar .v {
    font-family: var(--display);
    font-size: 12px;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 6px;
    font-variant-numeric: tabular-nums;
}
.xlabels {
    position: absolute;
    left: 30px; right: 0; bottom: 0;
    display: flex;
    justify-content: space-around;
    gap: 8px;
}
.xlabels span {
    flex: 1;
    max-width: 46px;
    text-align: center;
    font-size: 11.5px;
    color: var(--grey-2);
    font-weight: 500;
}
.chart-legend {
    display: flex;
    gap: 18px;
    margin-top: 6px;
    font-size: 12px;
    color: var(--grey-2);
    font-weight: 500;
}
.chart-legend i {
    display: inline-block;
    width: 11px; height: 11px;
    border-radius: 3px;
    margin-right: 6px;
    vertical-align: -1px;
}

/* Gauge */
.gauge-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 6px;
}
.gauge {
    position: relative;
    width: 170px;
    height: 170px;
}
.gauge .cap {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.gauge .cap b {
    font-family: var(--display);
    font-size: 40px;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--ink);
    line-height: 1;
}
.gauge .cap small {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--grey-2);
    margin-top: 5px;
    max-width: 108px;
    text-align: center;
    line-height: 1.3;
}
.gauge-stats {
    width: 100%;
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 13px;
}
.gs-row { display: flex; flex-direction: column; gap: 6px; }
.gs-top {
    display: flex;
    justify-content: space-between;
    font-size: 12.5px;
}
.gs-top .n { color: var(--grey); font-weight: 500; }
.gs-top .p {
    font-family: var(--display);
    font-weight: 700;
    color: var(--ink);
}
.gs-bar {
    height: 6px;
    border-radius: 99px;
    background: var(--bg);
    overflow: hidden;
}
.gs-bar i {
    display: block;
    height: 100%;
    border-radius: 99px;
}

/* Donut */
.donut-wrap {
    display: flex;
    align-items: center;
    gap: 22px;
    margin-top: 8px;
}
.donut { position: relative; flex-shrink: 0; }
.donut .ctr {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.donut .ctr b {
    font-family: var(--display);
    font-size: 30px;
    font-weight: 700;
    color: var(--ink);
    line-height: 1;
}
.donut .ctr small {
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--grey-2);
    margin-top: 3px;
}
.legend {
    display: flex;
    flex-direction: column;
    gap: 11px;
    flex: 1;
}
.lg {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
}
.lg i {
    width: 11px; height: 11px;
    border-radius: 3px;
    flex-shrink: 0;
}
.lg .n { color: var(--grey); font-weight: 500; flex: 1; }
.lg .c {
    font-family: var(--display);
    font-weight: 700;
    color: var(--ink);
}
.donut-foot {
    display: flex;
    align-items: center;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #F0F1F2;
}
.df-item { flex: 1; display: flex; flex-direction: column; gap: 5px; }
.df-l { font-size: 11px; font-weight: 600; color: var(--grey-2); }
.df-v {
    font-family: var(--display);
    font-size: 22px;
    font-weight: 700;
    color: var(--ink);
    letter-spacing: -0.02em;
}
.df-v small { font-size: 13px; color: var(--grey-2); font-weight: 600; letter-spacing: 0; }
.df-sep { width: 1px; height: 34px; background: #F0F1F2; margin: 0 16px; }

/* Plan progress card (dashboard preview of kanban) */
.prog-overall {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin: 4px 0 4px;
}
.prog-overall b {
    font-family: var(--display);
    font-size: 34px;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--ink);
}
.prog-overall span { font-size: 13px; color: var(--grey-2); font-weight: 500; }
.seg-bar {
    display: flex;
    gap: 3px;
    height: 9px;
    margin: 15px 0 13px;
}
.seg-bar i { border-radius: 99px; transition: flex 0.35s; }
.kstat-legend {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 12px;
    color: var(--grey);
}
.kstat-legend span { display: inline-flex; align-items: center; gap: 7px; }
.kstat-legend .d {
    width: 9px; height: 9px;
    border-radius: 50%;
}
.kstat-legend b { color: var(--ink); font-weight: 700; }
.next-label {
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--grey-2);
    margin: 19px 0 10px;
}
.mini-card {
    border: 1px solid var(--stroke);
    border-radius: 11px;
    padding: 12px 13px;
    cursor: pointer;
    transition: 150ms;
    background: var(--white);
    display: block;
    text-decoration: none;
    color: inherit;
}
.mini-card:hover {
    border-color: #F2C9C9;
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

/* Kanban label (also used in plan-progress mini-card) */
.klabel {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 4px 9px;
    border-radius: 6px;
    margin-bottom: 10px;
}
.klabel::before {
    content: "";
    width: 6px; height: 6px;
    border-radius: 50%;
    background: currentColor;
}
.klabel.must   { background: var(--light-red); color: var(--red-acc); }
.klabel.should { background: #EFF0F2; color: #33353B; }
.klabel.nice   { background: #F4F5F6; color: var(--grey); }
.kbadges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    margin-bottom: 10px;
}
.kbadges .klabel { margin-bottom: 0; }
.kowner {
    display: inline-flex;
    align-items: center;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 4px 9px;
    border-radius: 6px;
}
.kowner.kowner-ra { background: #FFEAEC; color: var(--red-acc); }
.kowner.kowner-client { background: #E8F0FE; color: #1A56DB; }
.kowner.kowner-joint { background: #FFF6E0; color: #92571A; }
.ktags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}
.ktag {
    display: inline-flex;
    align-items: center;
    font-size: 10.5px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 6px;
    text-decoration: none;
}
.ktag-source {
    background: #F4F5F6;
    color: var(--grey-2);
}
.ktag-module {
    background: #161718;
    color: #fff;
}
.ktag-module:hover {
    background: #2A2C31;
}
.ktt {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--ink);
    line-height: 1.38;
    margin-bottom: 6px;
}
.ktd {
    font-size: 12px;
    color: var(--grey-2);
    line-height: 1.5;
    margin-bottom: 12px;
}
.kfoot {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.kdue {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--grey-2);
    background: #F5F5F5;
    border-radius: 7px;
    padding: 4px 9px;
}
.kdue svg { width: 13px; height: 13px; }
.kdue.soon { background: var(--light-red); color: var(--red-acc); }
.kdue.fait {
    background: var(--ink);
    color: #fff;
}
.kava {
    width: 26px; height: 26px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 9.5px;
    font-weight: 700;
    color: #fff;
    font-family: var(--display);
    background: linear-gradient(135deg, #2A2C31, #161718);
}
.kava.cr { background: linear-gradient(135deg, #FF5C5C, #C70F0F); }

/* Deadlines list */
.dl-row {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 13px 0;
    border-bottom: 1px solid #F0F1F2;
}
.dl-row:last-child { border-bottom: none; padding-bottom: 0; }
.dl-date {
    width: 48px;
    flex-shrink: 0;
    text-align: center;
    border-radius: 10px;
    padding: 7px 0;
    background: var(--bg);
}
.dl-date b {
    font-family: var(--display);
    font-size: 17px;
    font-weight: 700;
    color: var(--ink);
    display: block;
    line-height: 1;
}
.dl-date small {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--grey-2);
}
.dl-row.urgent .dl-date { background: var(--light-red); }
.dl-row.urgent .dl-date b { color: var(--red-acc); }
.dl-body { flex: 1; min-width: 0; }
.dl-body .t {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--ink);
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dl-body .s {
    font-size: 11.5px;
    color: var(--grey-2);
    font-weight: 500;
    margin-top: 3px;
    display: flex;
    align-items: center;
    gap: 7px;
}
.dl-body .s i {
    width: 7px; height: 7px;
    border-radius: 50%;
}

/* Timeline (recent activity) */
.timeline { margin-top: 8px; }
.ev {
    display: flex;
    gap: 14px;
    padding: 13px 0;
    border-bottom: 1px solid #F0F1F2;
}
.ev:last-child { border-bottom: none; padding-bottom: 2px; }
.ev .dot {
    width: 34px; height: 34px;
    border-radius: 10px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
}
.ev .dot svg { width: 16px; height: 16px; stroke-width: 2; }
.dot.done  { background: var(--green-bg);   color: var(--green); }
.dot.req   { background: var(--light-purple); color: var(--blue); }
.dot.doc   { background: var(--slate-bg);   color: var(--slate); }
.dot.reply { background: var(--light-red);  color: var(--red-acc); }
.ev .body { flex: 1; min-width: 0; }
.ev .t {
    font-size: 13.5px;
    font-weight: 500;
    color: var(--ink);
    line-height: 1.4;
}
.ev .t b { font-weight: 600; }
.ev .ti {
    font-size: 11.5px;
    color: var(--grey-2);
    font-weight: 500;
    white-space: nowrap;
    margin-left: 12px;
}
.ev .row1 {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

/* Side stack: CNIL + Forfait cards */
.side-stack {
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.tag.tag-active {
    background: var(--green-bg);
    color: var(--green);
    border: 1px solid var(--green-bd);
}
.tag .pulse {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--green);
    animation: tagPulse 2s infinite;
}
@keyframes tagPulse {
    0%   { box-shadow: 0 0 0 0    rgba(235, 20, 20, 0.45); }
    70%  { box-shadow: 0 0 0 7px  rgba(235, 20, 20, 0); }
    100% { box-shadow: 0 0 0 0    rgba(235, 20, 20, 0); }
}
.panel p.lead {
    font-size: 13.5px;
    color: var(--grey);
    line-height: 1.6;
    margin-top: 14px;
}
.panel p.lead b { color: var(--ink); font-weight: 600; }
.meta-line {
    font-size: 12.5px;
    color: var(--grey-2);
    margin-top: 12px;
}
.meta-line b { color: var(--grey); font-weight: 600; }
.dl {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 18px;
    font-size: 13px;
    font-weight: 600;
    color: var(--red-acc);
    cursor: pointer;
    padding: 9px 0;
    transition: gap 0.15s;
}
.dl svg { width: 16px; height: 16px; }
.dl:hover { gap: 11px; }
.forfait .ico {
    width: 38px; height: 38px;
    border-radius: 11px;
    background: var(--light-red);
    color: var(--red-acc);
    display: grid;
    place-items: center;
    margin-bottom: 14px;
}
.forfait .ico svg { width: 19px; height: 19px; stroke-width: 1.9; }

@media (max-width: 1080px) {
    .stats { grid-template-columns: repeat(2, 1fr); }
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
}


/* ========================================================================
   Action plan — Kanban
   ======================================================================== */
.kanban {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    align-items: start;
}
.kcol {
    background: #ECEEF0;
    border: 1px solid var(--stroke);
    border-radius: 14px;
    padding: 12px 12px 8px;
    transition: background 150ms, border-color 150ms;
}
.kcol.dragover {
    border-color: var(--red);
    background: var(--light-red);
}
.kcol-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 6px 11px;
}
.kcol-head .t {
    font-family: var(--display);
    font-size: 14px;
    font-weight: 600;
    color: var(--ink);
    display: flex;
    align-items: center;
    gap: 9px;
    letter-spacing: -0.01em;
}
.kcol-head .dotc {
    width: 9px; height: 9px;
    border-radius: 50%;
}
.kcol-head .count {
    font-size: 12px;
    font-weight: 700;
    color: var(--grey-2);
    background: var(--white);
    border: 1px solid var(--stroke);
    border-radius: 99px;
    padding: 2px 10px;
    min-width: 24px;
    text-align: center;
}
.kcol-cards {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 54px;
}
.kcard {
    background: var(--white);
    border: 1px solid var(--stroke);
    border-radius: 11px;
    padding: 13px 14px;
    box-shadow: var(--shadow-sm);
    cursor: grab;
    transition: box-shadow 150ms, transform 120ms;
}
.kcard:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}
.kcard:active { cursor: grabbing; }
.kcard.dragging {
    opacity: 0.5;
    box-shadow: var(--shadow-lg);
    transform: rotate(1.5deg);
}

@media (max-width: 920px) {
    .kanban { grid-template-columns: 1fr; }
}


/* ========================================================================
   Annual report — magazine layout
   ======================================================================== */

/* Compact executive summary card at the top (above the magazine doc) */
.report-summary {
    margin-bottom: 24px;
    padding: 28px;
}
.synth {
    font-size: 14.5px;
    color: var(--grey);
    line-height: 1.7;
    max-width: 880px;
}
.synth b { color: var(--ink); font-weight: 600; }
.rep-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin: 22px 0 6px;
}
.rep-stat {
    border: 1px solid var(--stroke);
    border-radius: 13px;
    padding: 18px;
    background: #FCFCFC;
}
.rep-stat .l {
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--grey-2);
}
.rep-stat .v {
    font-family: var(--display);
    font-size: 30px;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-top: 9px;
    color: var(--ink);
}
.bar-row {
    display: grid;
    grid-template-columns: 220px 1fr 40px;
    align-items: center;
    gap: 16px;
    padding: 9px 0;
}
.bar-row .name { font-size: 13.5px; color: var(--ink); font-weight: 500; }
.bar-track {
    height: 10px;
    background: var(--bg);
    border-radius: 99px;
    overflow: hidden;
}
.bar-track i {
    display: block;
    height: 100%;
    border-radius: 99px;
    background: var(--red-grad);
}
.bar-row .n {
    font-family: var(--display);
    font-weight: 700;
    text-align: right;
    font-variant-numeric: tabular-nums;
    color: var(--ink);
}

/* Year-end preview banner — shown to non-demo orgs above the sample report */
.report-preview-banner {
    display: flex;
    align-items: flex-start;
    gap: 18px;
    padding: 20px 24px;
    margin-bottom: 22px;
    background: #FFF7E6;
    border: 1px solid #F2D69E;
    border-radius: 14px;
    color: var(--ink);
}
.report-preview-banner .rpb-icon {
    flex-shrink: 0;
    width: 38px; height: 38px;
    border-radius: 10px;
    background: #FBE2B0;
    color: #8A5A00;
    display: flex; align-items: center; justify-content: center;
}
.report-preview-banner .rpb-body { flex: 1; min-width: 0; }
.report-preview-banner .rpb-title {
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 4px;
}
.report-preview-banner .rpb-text {
    font-size: 13.5px;
    color: var(--grey);
    line-height: 1.6;
    margin: 0;
    max-width: 880px;
}
.report-preview-banner .rpb-text b { color: var(--ink); font-weight: 600; }

/* Magazine document container */
.ar-doc {
    background: var(--white);
    border: 1px solid var(--stroke);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

/* Preview-mode sample stamp on the magazine doc */
.ar-doc-preview { position: relative; }
.ar-preview-stamp {
    position: absolute;
    top: 22px; right: 22px;
    z-index: 5;
    padding: 7px 14px;
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.92);
    color: #C70F0F;
    border: 1.5px solid #C70F0F;
    font-family: var(--display);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    box-shadow: 0 4px 14px rgba(199, 15, 15, 0.18);
    transform: rotate(4deg);
    pointer-events: none;
}

/* Cover */
.ar-cover {
    position: relative;
    padding: 42px 44px 34px;
    background: linear-gradient(135deg, #FF4848 0%, #C70F0F 100%);
    color: #fff;
    overflow: hidden;
}
.ar-cover::after {
    content: "";
    position: absolute;
    right: -90px; top: -100px;
    width: 340px; height: 340px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.16), transparent 70%);
    pointer-events: none;
}
.ar-cover::before {
    content: "";
    position: absolute;
    right: 56px; bottom: -130px;
    width: 250px; height: 250px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.18);
    pointer-events: none;
}
.ar-cover-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    position: relative;
    z-index: 1;
}
.ar-kicker {
    font-size: 11.5px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.82);
}
.ar-year {
    font-family: var(--display);
    font-size: 30px;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.92);
    letter-spacing: 0.02em;
}
.ar-title {
    position: relative;
    z-index: 1;
    font-family: var(--display);
    font-size: 34px;
    line-height: 1.08;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 22px 0 0;
    color: #fff;
    max-width: 15ch;
}
.ar-sub {
    position: relative;
    z-index: 1;
    font-size: 15px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.9);
    margin: 14px 0 0;
    max-width: 58ch;
}
.ar-cover-meta {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 36px;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.22);
}
.ar-cover-meta > div { display: flex; flex-direction: column; gap: 3px; }
.ar-cover-meta .k {
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.72);
}
.ar-cover-meta .v { font-size: 14.5px; font-weight: 600; color: #fff; }

/* Sections */
.ar-section {
    padding: 32px 44px;
    border-bottom: 1px solid var(--stroke);
}
.ar-lbl {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    color: var(--red-acc);
}
.ar-h {
    font-family: var(--display);
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.015em;
    color: var(--ink);
    margin: 7px 0 0;
}
.ar-section > p {
    font-size: 14.5px;
    line-height: 1.72;
    color: var(--grey);
    margin: 14px 0 0;
    max-width: 74ch;
}
.ar-section > p + p { margin-top: 12px; }

/* KPI cards */
.ar-kpis {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-top: 22px;
}
.ar-kpi {
    padding: 18px 18px 16px;
    border: 1px solid var(--stroke);
    border-radius: 14px;
    background: linear-gradient(180deg, #FFF6F6 0%, #FFFFFF 62%);
}
.ar-kpi .n {
    font-family: var(--display);
    font-size: 34px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--ink);
    line-height: 1;
}
.ar-kpi .n span {
    font-size: 18px;
    font-weight: 700;
    color: var(--red-pure);
    margin-left: 1px;
}
.ar-kpi .l {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--ink);
    margin-top: 11px;
}
.ar-kpi .d {
    font-size: 11.5px;
    color: var(--grey-2);
    margin-top: 3px;
}

/* Quarterly timeline */
.ar-timeline {
    margin-top: 22px;
    padding-left: 4px;
}
.ar-tl {
    display: grid;
    grid-template-columns: 54px 1fr;
    gap: 18px;
    position: relative;
    padding-bottom: 22px;
}
.ar-tl:last-child { padding-bottom: 0; }
.ar-tl::before {
    content: "";
    position: absolute;
    left: 26px; top: 42px; bottom: -2px;
    width: 2px;
    background: var(--stroke);
}
.ar-tl:last-child::before { display: none; }
.ar-tl .q {
    width: 54px; height: 40px;
    border-radius: 11px;
    background: var(--red-grad);
    color: #fff;
    font-family: var(--display);
    font-weight: 700;
    font-size: 15px;
    display: grid;
    place-items: center;
    box-shadow: 0 6px 16px -7px rgba(235, 20, 20, 0.6);
    position: relative;
    z-index: 1;
}
.ar-tl .t {
    font-size: 14.5px;
    font-weight: 700;
    color: var(--ink);
    margin-top: 8px;
}
.ar-tl .d {
    font-size: 13px;
    line-height: 1.6;
    color: var(--grey);
    margin-top: 4px;
    max-width: 66ch;
}

/* Compliance status rows */
.ar-comp { margin-top: 20px; }
.ar-crow {
    display: grid;
    grid-template-columns: 1fr 170px 116px;
    align-items: center;
    gap: 18px;
    padding: 13px 0;
    border-bottom: 1px solid var(--stroke);
}
.ar-crow:last-child { border-bottom: none; }
.ar-crow .cl { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.ar-ctrack {
    height: 8px;
    background: var(--bg);
    border-radius: 99px;
    overflow: hidden;
}
.ar-ctrack i {
    display: block;
    height: 100%;
    background: var(--red-grad);
    border-radius: 99px;
}
.ar-cpill {
    justify-self: end;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 11px;
    border-radius: 99px;
    border: 1px solid;
    white-space: nowrap;
}
.ar-cpill.ok   { color: #fff; background: var(--ink);      border-color: var(--ink); }
.ar-cpill.prog { color: var(--red-acc); background: var(--light-red); border-color: #F4D9D9; }
.ar-cpill.todo { color: var(--grey); background: var(--bg); border-color: var(--stroke); }

/* Impact callout */
.ar-impact {
    padding: 30px 44px;
    background: linear-gradient(135deg, #FFF0F0 0%, #FFF8F8 100%);
    border-bottom: 1px solid var(--stroke);
    display: flex;
    gap: 20px;
    align-items: flex-start;
}
.ar-impact-ico {
    width: 50px; height: 50px;
    flex-shrink: 0;
    border-radius: 14px;
    background: var(--red-grad);
    display: grid;
    place-items: center;
    box-shadow: 0 8px 20px -8px rgba(235, 20, 20, 0.55);
    color: #fff;
}
.ar-impact-ico svg { width: 26px; height: 26px; color: #fff; }
.ar-impact h4 {
    font-family: var(--display);
    font-size: 18px;
    font-weight: 700;
    color: var(--ink);
    margin: 2px 0 0;
}
.ar-impact p {
    font-size: 14px;
    line-height: 1.7;
    color: var(--grey);
    margin: 9px 0 0;
    max-width: 74ch;
}

/* Priorities grid */
.ar-reco {
    margin-top: 22px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
.ar-reco-item {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 16px 18px;
    border: 1px solid var(--stroke);
    border-radius: 14px;
    background: var(--white);
}
.ar-reco-item .num {
    font-family: var(--display);
    font-size: 20px;
    font-weight: 700;
    color: var(--red-pure);
    line-height: 1.1;
    opacity: 0.9;
}
.ar-reco-item .t {
    font-size: 14px;
    font-weight: 700;
    color: var(--ink);
}
.ar-reco-item .d {
    font-size: 12.5px;
    line-height: 1.6;
    color: var(--grey);
    margin-top: 4px;
}

/* Sign-off */
.ar-sign {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 24px 44px;
    background: var(--bg);
}
.ar-sign-l { display: flex; align-items: center; gap: 13px; }
.ar-monogram {
    width: 42px; height: 42px;
    border-radius: 12px;
    background: var(--red-grad);
    display: grid;
    place-items: center;
    color: #fff;
    font-family: var(--display);
    font-weight: 800;
    font-size: 14px;
    letter-spacing: 0.03em;
    box-shadow: 0 6px 16px -7px rgba(235, 20, 20, 0.6);
}
.ar-sign .t { font-size: 13.5px; font-weight: 700; color: var(--ink); }
.ar-sign .d { font-size: 12px; color: var(--grey-2); margin-top: 2px; }
.ar-sign-r { font-size: 12.5px; font-weight: 600; color: var(--grey-2); }

@media (max-width: 900px) {
    .ar-kpis { grid-template-columns: 1fr 1fr; }
    .ar-reco { grid-template-columns: 1fr; }
    .ar-crow { grid-template-columns: 1fr 116px; }
    .ar-crow .ar-ctrack { display: none; }
    .ar-cover, .ar-section, .ar-impact, .ar-sign { padding-left: 24px; padding-right: 24px; }
    .ar-title { font-size: 27px; }
    .rep-stats { grid-template-columns: repeat(2, 1fr); }
}

@media print {
    .sidebar, .topbar, .dpo-fab, .page-head, .report-summary { display: none !important; }
    .app { display: block !important; }
    .content { padding: 0 !important; max-width: none !important; }
    .ar-doc { box-shadow: none; border: none; border-radius: 0; margin: 0; }
    .ar-doc, .ar-doc * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .ar-section, .ar-impact, .ar-tl, .ar-reco-item { break-inside: avoid; }
}


/* ========================================================================
   Documents — row-based list with type icons
   ======================================================================== */
.doc-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    border-bottom: 1px solid #F1F2F3;
    transition: background 140ms ease-out;
}
.doc-row:last-child { border-bottom: none; }
.doc-row:hover { background: #FBFBFC; }
.doc-ico {
    width: 42px; height: 42px;
    border-radius: 11px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    font-family: var(--display);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
}
.doc-ico.pdf { background: var(--light-red);  color: var(--red-acc); }
.doc-ico.doc { background: var(--blue-bg);    color: var(--blue); }
.doc-ico.xls { background: var(--green-bg);   color: var(--green); }
.doc-info { flex: 1; min-width: 0; }
.doc-info .t { font-size: 14px; font-weight: 600; color: var(--ink); }
.doc-info .s { font-size: 12px; color: var(--grey-2); margin-top: 3px; }
.doc-cat {
    font-size: 11.5px;
    font-weight: 600;
    color: var(--grey);
    background: var(--bg);
    border: 1px solid var(--stroke);
    border-radius: 7px;
    padding: 5px 10px;
    white-space: nowrap;
}
.doc-size {
    font-size: 12.5px;
    color: var(--grey-2);
    width: 64px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}
.doc-dl {
    width: 34px; height: 34px;
    border-radius: 9px;
    display: grid;
    place-items: center;
    color: var(--grey-2);
    cursor: pointer;
    transition: 150ms;
}
.doc-dl:hover { background: var(--light-red); color: var(--red-acc); }
.doc-dl svg { width: 17px; height: 17px; }

/* Tab-pill (also reused on demands and other filter rows) */
.tab-pill {
    font-family: var(--sans);
    font-size: 13px;
    font-weight: 600;
    color: var(--grey);
    padding: 7px 14px;
    border-radius: 9px;
    background: var(--bg);
    border: 1px solid var(--stroke);
    transition: 150ms;
}
.tab-pill:hover { color: var(--ink); border-color: #D4D6DA; }
.tab-pill.active {
    background: var(--ink);
    color: #fff;
    border-color: var(--ink);
}

/* ---------- Database admin page ----------------------------------------- */
.db-section-title {
    font-size: 17px;
    font-weight: 700;
    margin: 28px 0 14px;
    color: var(--ink);
}
.db-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin-bottom: 12px;
}
@media (max-width: 900px) { .db-grid { grid-template-columns: 1fr; } }
.db-card { padding: 22px 24px; }
.db-card-head {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 10px;
}
.db-card-title { font-size: 17px; font-weight: 700; color: var(--ink); }
.db-card-text {
    color: var(--grey);
    font-size: 14px;
    line-height: 1.55;
    margin: 4px 0 18px;
}
.db-icon {
    width: 44px; height: 44px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.db-icon-blue   { background: #E8F1FE; color: #2A6DF4; }
.db-icon-orange { background: #FFEFE0; color: #E07A11; }

.btn-blue {
    background: #1F6FEB;
    color: #fff;
    box-shadow: 0 6px 18px -6px rgba(31, 111, 235, 0.55);
}
.btn-blue:hover { background: #1A5FCC; color: #fff; transform: translateY(-1px); }
.btn-orange {
    background: #E07A11;
    color: #fff;
    box-shadow: 0 6px 18px -6px rgba(224, 122, 17, 0.55);
}
.btn-orange:hover { background: #C56809; color: #fff; transform: translateY(-1px); }
.btn-green {
    background: #1E9F5C;
    color: #fff;
    box-shadow: 0 6px 18px -6px rgba(30, 159, 92, 0.55);
}
.btn-green:hover { background: #178049; color: #fff; transform: translateY(-1px); }

.db-drop {
    display: block;
    border: 2px dashed #D1D5DA;
    border-radius: 10px;
    padding: 30px 18px;
    text-align: center;
    cursor: pointer;
    background: #FBFBFC;
    transition: 150ms;
}
.db-drop:hover, .db-drop.is-drag {
    border-color: #1F6FEB;
    background: #F4F9FF;
}
.db-drop input[type="file"] { display: none; }
.db-drop-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--grey);
}
.db-drop-text { font-size: 13.5px; font-weight: 500; }
.db-drop-filename {
    font-size: 12.5px;
    color: var(--ink);
    font-weight: 600;
    min-height: 16px;
}
.db-action-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 14px;
}
.db-scheduled-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin: 28px 0 12px;
    gap: 16px;
    flex-wrap: wrap;
}
.db-scheduled-head .db-section-title { margin: 0; }
.db-sched-sub {
    font-size: 12.5px;
    color: var(--grey-2);
    margin-top: 4px;
}
.db-sched-sub code {
    font-family: var(--mono, ui-monospace, SFMono-Regular, monospace);
    font-size: 12px;
    background: #F4F4F6;
    padding: 1px 6px;
    border-radius: 4px;
}
.db-s3-table { margin: 0; }
.db-file-cell { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; }
.db-row-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
    text-decoration: none;
    background: transparent;
    border: none;
    cursor: pointer;
    font-family: var(--sans);
}
.db-row-link-blue   { color: #1F6FEB; }
.db-row-link-blue:hover   { background: #E8F1FE; color: #1A5FCC; }
.db-row-link-orange { color: #E07A11; }
.db-row-link-orange:hover { background: #FFEFE0; color: #C56809; }
.db-inline-form { display: inline; margin-left: 6px; }

/* ==========================================================================
   Admin → Organisation detail page (rich multi-section layout)
   ========================================================================== */

/* Generic two-column grid used between sections. */
.org-detail-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin-bottom: 18px;
    align-items: start;
}
@media (max-width: 980px) {
    .org-detail-grid-2 { grid-template-columns: 1fr; }
}

.section-title {
    font-family: var(--display);
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin: 14px 0 10px;
    color: var(--ink);
}
.card-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 18px 0 10px;
    gap: 10px;
}
.section-error {
    background: #FFF6F6;
    border-color: #F4D2D2;
}
.section-divider {
    border: none;
    border-top: 1px solid var(--stroke);
    margin: 18px 0 14px;
}

/* ---------- Section 1 — Header strip ---------- */
.org-header-strip { padding: 18px 22px; margin-bottom: 18px; }
.org-header-grid {
    display: grid;
    grid-template-columns: 1.1fr 1.4fr 1.3fr 1.5fr 1.4fr;
    gap: 22px;
    align-items: center;
}
@media (max-width: 1100px) {
    .org-header-grid { grid-template-columns: 1fr 1fr 1fr; row-gap: 16px; }
    .org-header-hours { grid-column: 1 / -1; }
}
.org-header-col .lab {
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.11em;
    text-transform: uppercase;
    color: var(--grey-2);
    margin-bottom: 6px;
}
.org-header-val {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--ink);
    font-weight: 500;
    font-size: 13.5px;
}
.org-header-val.muted   { color: var(--grey-2); }
.org-header-val.pending { color: var(--red-acc); }
.org-header-val.missing { color: var(--red-acc); }
.org-header-val svg { stroke-width: 1.8; }

.tier-badge {
    display: inline-block;
    font-family: var(--display);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.09em;
    padding: 6px 12px;
    border-radius: 7px;
    text-transform: uppercase;
    color: #fff;
    background: var(--grey);
}
.tier-starter       { background: linear-gradient(135deg, #94969E, #6F7178); }
.tier-core          { background: linear-gradient(135deg, #FD1D1D, #EB1414); }
.tier-comprehensive { background: linear-gradient(135deg, #0F0F12, #2A2A30); }

.hours-bar {
    margin-top: 8px;
    height: 7px;
    border-radius: 99px;
    background: #EFE7E7;
    overflow: hidden;
    min-width: 140px;
}
.hours-bar i {
    display: block;
    height: 100%;
    background: var(--red-grad);
    border-radius: 99px;
}

/* ---------- Section 2 — Compliance snapshot ---------- */
.compliance-grid {
    display: grid;
    grid-template-columns: 1fr 1.4fr 1fr 1fr;
    gap: 18px;
    margin-bottom: 18px;
}
@media (max-width: 1100px) {
    .compliance-grid { grid-template-columns: 1fr 1fr; }
}
.compliance-card { padding: 18px 20px; }
.compliance-card-head .lab {
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.11em;
    text-transform: uppercase;
    color: var(--grey-2);
    margin-bottom: 8px;
}
.big-num {
    font-family: var(--display);
    font-size: 38px;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1;
    color: var(--ink);
    margin-bottom: 8px;
}
.big-num.danger { color: var(--red-acc); }
.big-num-unit {
    font-size: 18px;
    color: var(--grey-2);
    font-weight: 500;
    letter-spacing: 0;
}
.pillar-bars { display: flex; flex-direction: column; gap: 4px; }

/* Each pillar row is a <details> disclosure — clicking the row reveals
   a plain-language explanation and a "what to do" checklist. */
.pillar-details {
    border-radius: 8px;
    transition: background 140ms;
}
.pillar-details[open] { background: #FBFAF8; }
.pillar-details > summary {
    list-style: none;            /* hide native disclosure triangle */
    cursor: pointer;
    display: grid;
    grid-template-columns: 110px 1fr 36px 16px;
    gap: 10px;
    align-items: center;
    font-size: 12.5px;
    padding: 7px 8px;
    border-radius: 8px;
}
.pillar-details > summary::-webkit-details-marker { display: none; }
.pillar-details > summary:hover { background: var(--bg); }
.pillar-details[open] > summary { background: transparent; }
.pillar-details > summary:focus-visible {
    outline: 2px solid var(--red-acc);
    outline-offset: 1px;
}
.pillar-label { color: var(--grey); }
.pillar-track {
    height: 6px;
    background: #F1F1F2;
    border-radius: 99px;
    overflow: hidden;
}
.pillar-track i {
    display: block;
    height: 100%;
    background: var(--red-grad);
    border-radius: 99px;
}
.pillar-pct {
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    color: var(--ink);
}
.pillar-info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--grey-2);
    transition: transform 180ms, color 180ms;
}
.pillar-details[open] .pillar-info-icon {
    transform: rotate(45deg);    /* doubles as a 'close' affordance */
    color: var(--red-acc);
}

.pillar-detail {
    padding: 4px 12px 12px;
    border-left: 2px solid var(--red-acc);
    margin: 2px 8px 6px;
    background: #FFFEFB;
    border-radius: 0 8px 8px 0;
}
.pillar-detail-what {
    font-size: 12.5px;
    color: var(--grey);
    line-height: 1.55;
    margin: 8px 0 10px;
}
.pillar-detail-todo-head {
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--red-acc);
    margin-bottom: 6px;
}
.pillar-detail-todo {
    list-style: none;
    padding: 0;
    margin: 0;
}
.pillar-detail-todo li {
    position: relative;
    padding: 4px 0 4px 18px;
    font-size: 12.5px;
    color: var(--ink);
    line-height: 1.5;
}
.pillar-detail-todo li::before {
    content: "";
    position: absolute;
    left: 2px;
    top: 11px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--red-acc);
}
.coverage-bar {
    height: 7px;
    border-radius: 99px;
    background: #F1F1F2;
    overflow: hidden;
    margin-bottom: 8px;
}
.coverage-bar i { display: block; height: 100%; background: var(--red-grad); }

.risk-severity-row { display: flex; flex-wrap: wrap; gap: 6px; }
.risk-chip {
    display: inline-flex;
    align-items: center;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 9px;
    border-radius: 7px;
    border: 1px solid var(--stroke);
    background: var(--white);
    color: var(--grey);
}
.risk-critical { background: #FFE9EB; color: #B30410; border-color: #F4D2D2; }
.risk-high     { background: #FFF0F0; color: var(--red-acc); border-color: #F4D2D2; }
.risk-medium   { background: var(--amber-bg); color: var(--amber); border-color: var(--amber-bd); }
.risk-low      { background: var(--blue-bg); color: var(--blue); border-color: var(--blue-bd); }

/* ---------- Section 3 — Action plan panel ---------- */
.action-plan-counters {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin: 14px 0 12px;
}
.ap-counter {
    background: var(--bg);
    border: 1px solid var(--stroke);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
}
.ap-counter-label {
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--grey-2);
}
.ap-counter-num {
    font-family: var(--display);
    font-size: 30px;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.1;
    color: var(--ink);
    margin-top: 4px;
}
.action-plan-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}
.oldest-items { list-style: none; padding: 0; margin: 0; }
.oldest-items li {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    border-top: 1px solid #F1F2F3;
    font-size: 13px;
}
.oldest-items li:first-child { border-top: none; }
.oldest-title { font-weight: 600; color: var(--ink); }

/* ---------- Section 4 — Activities & processors ---------- */
.kv-strip {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 10px 0;
}
.kv {
    background: var(--bg);
    border: 1px solid var(--stroke);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
}
.kv-label {
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--grey-2);
}
.kv-val {
    font-family: var(--display);
    font-size: 22px;
    font-weight: 700;
    line-height: 1.1;
    color: var(--ink);
    margin-top: 2px;
}
.kv-list { list-style: none; padding: 0; margin: 8px 0 0; }
.kv-list li {
    padding: 7px 0;
    border-top: 1px solid #F1F2F3;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.kv-list li:first-child { border-top: none; }

/* ---------- Section 5 — DPIAs ---------- */
.filter-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 12px; }
.filter-chip {
    display: inline-flex;
    align-items: center;
    font-size: 12px;
    font-weight: 600;
    padding: 5px 11px;
    border-radius: 999px;
    background: var(--white);
    border: 1px solid var(--stroke);
    color: var(--grey);
    cursor: pointer;
    text-decoration: none;
}
.filter-chip:hover { border-color: #D4D6DA; color: var(--ink); }
.filter-chip.active {
    background: var(--light-red);
    color: var(--red-acc);
    border-color: #F4D2D2;
}

/* ---------- Section 6 — Demands counter strip ---------- */
.demands-counter-strip {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin: 8px 0;
}
.dc {
    display: block;
    background: var(--bg);
    border: 1px solid var(--stroke);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    text-decoration: none;
    color: inherit;
    transition: border-color 140ms;
}
.dc:hover { border-color: #D4D6DA; }
.dc-label {
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--grey-2);
}
.dc-num {
    font-family: var(--display);
    font-size: 26px;
    font-weight: 700;
    line-height: 1.1;
    color: var(--ink);
    margin-top: 3px;
}
.dc-overdue {
    background: #FFF0F0;
    border-color: #F4D2D2;
}
.dc-overdue .dc-num { color: var(--red-acc); }
.row-overdue { box-shadow: inset 3px 0 0 var(--red-acc); background: #FFFAFA; }

/* ---------- Section 7 — Documents richer panel ---------- */
.docs-by-kind {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
    margin: 8px 0 14px;
}
@media (max-width: 1100px) {
    .docs-by-kind { grid-template-columns: repeat(3, 1fr); }
}
.dbk {
    background: var(--bg);
    border: 1px solid var(--stroke);
    border-radius: var(--radius-sm);
    padding: 10px 11px;
    text-align: center;
}
.dbk-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--grey-2);
}
.dbk-num {
    font-family: var(--display);
    font-size: 20px;
    font-weight: 700;
    line-height: 1.1;
    color: var(--ink);
    margin-top: 3px;
}
.doc-recent-list { list-style: none; padding: 0; margin: 0; }
.doc-recent-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-top: 1px solid #F1F2F3;
}
.doc-recent-list li:first-child { border-top: none; }
.doc-recent-list svg { color: var(--grey); }
.doc-recent-body { flex: 1; min-width: 0; }
.doc-recent-title {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---------- Section 8 — Activity timeline ---------- */
.activity-feed { list-style: none; padding: 0; margin: 0; }
.af-row {
    display: flex;
    gap: 10px;
    padding: 9px 0;
    border-top: 1px solid #F1F2F3;
}
.af-row:first-child { border-top: none; }
.af-icon {
    flex: 0 0 26px;
    height: 26px;
    width: 26px;
    border-radius: 7px;
    background: var(--bg);
    border: 1px solid var(--stroke);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--grey);
}
.af-demand   .af-icon { background: #FFF0F0; color: var(--red-acc); border-color: #F4D2D2; }
.af-document .af-icon { background: var(--blue-bg); color: var(--blue); border-color: var(--blue-bd); }
.af-action   .af-icon { background: var(--amber-bg); color: var(--amber); border-color: var(--amber-bd); }
.af-note     .af-icon { background: #F1F1F2; color: var(--grey); border-color: var(--stroke); }
.af-body { min-width: 0; flex: 1; }
.af-label { font-size: 13px; font-weight: 600; color: var(--ink); }
.af-label[href]:hover { color: var(--red-acc); }

/* ---------- Section 9 — Internal notes ---------- */
.internal-notes-panel {
    background: #FFFAF0;          /* warm tint to signal "RA-only" */
    border-color: #F2E4C9;
}
.internal-notes-panel .card-title { color: #8A5A00; }
.internal-notes-panel .card-title svg { color: #8A5A00; }
.note-form { margin: 6px 0 14px; }
.note-form textarea {
    width: 100%;
    border: 1px solid #E6D6A8;
    background: #FFFEFB;
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    font-family: var(--sans);
    font-size: 13.5px;
    resize: vertical;
    min-height: 64px;
}
.note-form-actions { display: flex; justify-content: flex-end; margin-top: 8px; }
.notes-list { list-style: none; padding: 0; margin: 0; }
.note-item {
    background: #FFFEFB;
    border: 1px solid #F2E4C9;
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    margin-bottom: 8px;
}
.note-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    font-size: 12.5px;
    color: var(--grey);
}
.note-author { font-weight: 600; color: var(--ink); }
.note-body { font-size: 13.5px; color: var(--ink); white-space: pre-wrap; }
.note-delete {
    padding: 4px 8px;
    border-radius: 6px;
    color: var(--grey-2);
}
.note-delete:hover { color: var(--red-acc); }

/* ==========================================================================
   Compliance indicators — answer page (client + admin variants)
   ========================================================================== */

.indicators-overall {
    background: var(--white);
    border: 1px solid var(--stroke);
    border-radius: var(--radius);
    padding: 12px 16px;
    text-align: right;
    box-shadow: var(--shadow-sm);
    min-width: 180px;
}
.indicators-overall .lab {
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.11em;
    text-transform: uppercase;
    color: var(--grey-2);
    margin-bottom: 2px;
}
.indicators-overall .big-num {
    margin: 2px 0 2px;
}

.indicator-pillar { margin-bottom: 22px; }
.indicator-pillar-head {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 16px;
    align-items: center;
    padding: 10px 4px 12px;
}
.indicator-pillar-head h2 {
    font-family: var(--display);
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin: 0;
    color: var(--ink);
}
.indicator-pillar-progress {
    display: grid;
    grid-template-columns: 1fr 44px;
    gap: 10px;
    align-items: center;
}

.indicator-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.indicator-row {
    background: var(--white);
    border: 1px solid var(--stroke);
    border-radius: var(--radius);
    padding: 16px 18px;
    box-shadow: var(--shadow-sm);
    transition: border-color 140ms, box-shadow 140ms;
}
.indicator-row:hover {
    border-color: #D4D6DA;
    box-shadow: var(--shadow-md);
}

.indicator-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}
.indicator-title-wrap { flex: 1; min-width: 0; }
.indicator-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--ink);
    line-height: 1.4;
}
.indicator-desc-disclosure {
    margin-top: 4px;
}
.indicator-desc-disclosure summary {
    list-style: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11.5px;
    color: var(--grey-2);
    padding: 2px 0;
}
.indicator-desc-disclosure summary::-webkit-details-marker { display: none; }
.indicator-desc-disclosure summary:hover { color: var(--red-acc); }
.indicator-desc-disclosure p {
    margin: 6px 0 0;
    padding: 8px 12px;
    background: #FBFAF8;
    border-left: 2px solid var(--red-acc);
    border-radius: 0 6px 6px 0;
    font-size: 12.5px;
    color: var(--grey);
    line-height: 1.55;
}

.severity-chip {
    display: inline-flex;
    align-items: center;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    padding: 4px 9px;
    border-radius: 6px;
    border: 1px solid var(--stroke);
    background: var(--white);
    color: var(--grey-2);
    flex-shrink: 0;
}
.severity-critical { background: #FFE9EB; color: #B30410; border-color: #F4D2D2; }
.severity-high     { background: #FFF0F0; color: var(--red-acc); border-color: #F4D2D2; }
.severity-medium   { background: var(--amber-bg); color: var(--amber); border-color: var(--amber-bd); }
.severity-low      { background: var(--blue-bg); color: var(--blue); border-color: var(--blue-bd); }

.indicator-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}
.status-segmented {
    display: inline-flex;
    border: 1px solid var(--stroke);
    border-radius: var(--radius-sm);
    background: var(--bg);
    padding: 3px;
    gap: 2px;
    flex: 1;
    min-width: 0;
}
.seg-opt {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    font-size: 12.5px;
    font-weight: 600;
    padding: 7px 10px;
    border-radius: calc(var(--radius-sm) - 3px);
    cursor: pointer;
    color: var(--grey);
    transition: background 140ms, color 140ms;
    user-select: none;
}
.seg-opt input { display: none; }
.seg-opt:hover { color: var(--ink); }
.seg-opt.selected { background: var(--white); box-shadow: var(--shadow-sm); }
.seg-met.selected     { color: #0F7A2E; }
.seg-partial.selected { color: #B57000; }
.seg-not-met.selected { color: var(--red-acc); }
.seg-na.selected      { color: var(--grey); }
.indicator-save-btn { white-space: nowrap; }

.indicator-extras {
    display: grid;
    grid-template-columns: auto 1fr 2fr;
    gap: 10px;
    align-items: center;
    padding-top: 10px;
    border-top: 1px solid #F1F2F3;
}
.evidence-required-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10.5px;
    font-weight: 600;
    color: var(--red-acc);
    background: var(--light-red);
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid #F4D2D2;
    white-space: nowrap;
}
.extras-field {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}
.extras-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--grey-2);
}
.extras-field select,
.extras-field input[type="text"] {
    width: 100%;
    padding: 6px 8px;
    font-size: 12.5px;
    border: 1px solid var(--stroke);
    border-radius: 7px;
    background: var(--white);
    color: var(--ink);
}
.extras-field select:focus,
.extras-field input[type="text"]:focus {
    outline: none;
    border-color: var(--red-acc);
    box-shadow: 0 0 0 3px rgba(235, 20, 20, 0.10);
}

.indicator-meta {
    margin-top: 8px;
    font-size: 11.5px;
    color: var(--grey-2);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.indicator-meta svg { stroke-width: 1.7; }

@media (max-width: 760px) {
    .indicator-pillar-head { grid-template-columns: 1fr; }
    .indicator-controls { flex-wrap: wrap; }
    .indicator-extras { grid-template-columns: 1fr; }
    .status-segmented { width: 100%; }
}

/* ---------- Indicator auto-save state ---------- */

/* No-JS fallback: the Save button is visible by default; JS hides it. */
body.js-enabled .nojs-only { display: none; }

.save-state {
    display: inline-flex;
    align-items: center;
    min-width: 84px;
    height: 32px;
    padding: 0 10px;
    border-radius: 7px;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--grey-2);
    background: transparent;
    transition: background 200ms, color 200ms;
}
.save-state svg { stroke-width: 2; margin-right: 4px; }
.save-state > span { display: none; align-items: center; }
.save-state.is-saving .save-saving,
.save-state.is-saved  .save-saved,
.save-state.is-error  .save-error { display: inline-flex; }
.save-state.is-saving { color: var(--grey-2); }
.save-state.is-saving svg { animation: spin 800ms linear infinite; }
.save-state.is-saved  { color: #0F7A2E; background: #EAF7EE; }
.save-state.is-error  { color: var(--red-acc); background: var(--light-red); }

@keyframes spin { from { transform: rotate(0); } to { transform: rotate(360deg); } }

/* Brief border flash on the row on successful save. */
.indicator-row:has(.save-state.is-saved) {
    border-color: #B7E4C5;
    box-shadow: 0 0 0 3px rgba(15, 122, 46, 0.08);
}
