:root {
    --color-primary: #27ae60;
    --color-primary-dark: #1e874a;
    --color-secondary: #4caf50;
    --color-text: #1f2933;
    --color-muted: #64748b;
    --color-surface: #f8faf9;
    --color-surface-strong: #ffffff;
    --color-border: #d9e3de;
    --color-border-strong: #c8d5ce;
    --color-success-surface: #eaf8ef;
    --color-success-border: #bfe4ca;
    --color-danger: #b42318;
    --shadow-soft: 0 14px 34px rgba(31, 41, 51, 0.06);
    --shadow-focus: 0 0 0 4px rgba(39, 174, 96, 0.14);
    --sidebar-width: 260px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    color-scheme: light;
}

body {
    margin: 0;
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--color-surface);
    color: var(--color-text);
    line-height: 1.5;
}

img {
    display: block;
    max-width: 100%;
}

a {
    color: var(--color-primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

button,
.button-primary,
.button-secondary,
input,
select,
textarea {
    font: inherit;
}

button,
.button-primary,
.button-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 2.9rem;
    padding: 0.75rem 1.1rem;
    border-radius: 999px;
    border: 1px solid transparent;
    background: var(--color-primary);
    color: #fff;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

button:hover,
.button-primary:hover,
.button-secondary:hover {
    text-decoration: none;
    transform: translateY(-1px);
}

button:hover,
.button-primary:hover {
    background: var(--color-primary-dark);
}

.button-secondary {
    background: var(--color-surface-strong);
    border-color: var(--color-border);
    color: var(--color-text);
}

.button-secondary:hover {
    border-color: var(--color-secondary);
    color: var(--color-primary-dark);
}

.link-button {
    min-height: auto;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--color-primary);
    font-weight: 600;
}

.link-button:hover {
    background: transparent;
    transform: none;
    text-decoration: underline;
}

/* ── Layout: container (public pages) ── */

.container {
    width: min(1200px, calc(100% - 2rem));
    margin: 0 auto;
}

.site-main {
    padding-bottom: 3rem;
}

/* ── Environment banner ── */

.environment-banner {
    padding: 0.65rem 1rem;
    background: var(--color-text);
    color: #f8faf9;
    text-align: center;
    font-size: 0.9rem;
}

/* ══════════════════════════════════════════
   SIDEBAR LAYOUT (Authenticated)
   ══════════════════════════════════════════ */

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--color-surface-strong);
    border-right: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    z-index: 20;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-top {
    flex: 1;
    padding: 1.25rem 0.75rem 0.75rem;
}

.sidebar-bottom {
    padding: 0 0.75rem 0.75rem;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.4rem 0.6rem;
    margin-bottom: 1.25rem;
    color: inherit;
    text-decoration: none;
    border-radius: 0.6rem;
}

.sidebar-brand:hover {
    text-decoration: none;
    background: var(--color-surface);
}

.sidebar-logo {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    object-fit: contain;
}

.sidebar-brand-name {
    font-weight: 700;
    font-size: 1.05rem;
    line-height: 1.15;
    color: var(--color-text);
}

/* Org switcher */

.sidebar-org {
    margin-bottom: 1rem;
    padding: 0.6rem 0.7rem;
    background: var(--color-surface);
    border-radius: 0.6rem;
    border: 1px solid var(--color-border);
}

.sidebar-org-current {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.35rem;
}

#orgToggle {
    cursor: pointer;
}

.sidebar-org-name {
    font-weight: 600;
    font-size: 0.82rem;
    color: var(--color-text);
}

.sidebar-org-chevron {
    color: var(--color-muted);
    flex-shrink: 0;
    transition: transform 0.2s;
}

.sidebar-org-list.is-open ~ .sidebar-org-current .sidebar-org-chevron,
.sidebar-org-current:has(~ .sidebar-org-list.is-open) .sidebar-org-chevron {
    transform: rotate(180deg);
}

.sidebar-org-list {
    display: none;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--color-border);
}

.sidebar-org-list.is-open {
    display: block;
}

.sidebar-org-list form {
    margin: 0;
}

.sidebar-org-option {
    display: block;
    width: 100%;
    padding: 0.35rem 0.4rem;
    border: 0;
    border-radius: 0.35rem;
    background: transparent;
    color: var(--color-muted);
    font-size: 0.8rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    min-height: auto;
}

.sidebar-org-option:hover {
    background: var(--color-surface-strong);
    color: var(--color-primary);
    transform: none;
}

.sidebar-org-option.is-active {
    color: var(--color-primary-dark);
    font-weight: 600;
}

/* Sidebar navigation */

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-nav-secondary {
    padding-bottom: 0.5rem;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid var(--color-border);
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.55rem 0.7rem;
    border-radius: 0.5rem;
    color: var(--color-muted);
    font-weight: 500;
    font-size: 0.88rem;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}

.sidebar-link:hover {
    background: var(--color-surface);
    color: var(--color-text);
    text-decoration: none;
}

.sidebar-link.is-active {
    background: rgba(39, 174, 96, 0.1);
    color: var(--color-primary-dark);
    font-weight: 600;
}

.sidebar-link svg {
    flex-shrink: 0;
    opacity: 0.65;
}

.sidebar-link:hover svg {
    opacity: 0.85;
}

.sidebar-link.is-active svg {
    opacity: 1;
}

/* Sidebar user */

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.5rem;
}

.sidebar-avatar {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: var(--color-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 700;
    flex-shrink: 0;
    text-transform: uppercase;
}

.sidebar-user-info {
    flex: 1;
    min-width: 0;
}

.sidebar-user-name {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-logout {
    min-height: auto;
    padding: 0.3rem;
    border: 0;
    border-radius: 0.35rem;
    background: transparent;
    color: var(--color-muted);
    cursor: pointer;
}

.sidebar-logout:hover {
    background: rgba(180, 35, 24, 0.08);
    color: var(--color-danger);
    transform: none;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 19;
    background: rgba(31, 41, 51, 0.35);
}

body.sidebar-open .sidebar-overlay {
    display: block;
}

/* ── App main area ── */

.app-main {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── Top bar ── */

.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.65rem 2rem;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--color-border);
    min-height: 3.5rem;
}

.topbar-toggle {
    display: none;
    min-height: auto;
    padding: 0.4rem;
    border: 1px solid var(--color-border);
    border-radius: 0.5rem;
    background: var(--color-surface-strong);
    color: var(--color-text);
    cursor: pointer;
}

.topbar-toggle:hover {
    transform: none;
    background: var(--color-surface);
}

.topbar-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.2;
}

.topbar-actions {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
}

.topbar-filters {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.topbar-filters select,
.topbar-filters input[type="text"],
.topbar-filters input[type="date"] {
    padding: 0.4rem 0.65rem;
    border: 1px solid var(--color-border);
    border-radius: 0.5rem;
    background: var(--color-surface-strong);
    font-size: 0.82rem;
    color: var(--color-text);
    min-height: auto;
}

.topbar-filters select:focus,
.topbar-filters input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: var(--shadow-focus);
}

.topbar-avatar {
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 50%;
    background: var(--color-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    flex-shrink: 0;
    text-transform: uppercase;
}

/* ── Main content ── */

.main-content {
    flex: 1;
    padding: 1.5rem 2rem 3rem;
}

/* ══════════════════════════════════════════
   CLASSIC HEADER (Public / unauthenticated)
   ══════════════════════════════════════════ */

.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(12px);
    background: rgba(255, 255, 255, 0.94);
    border-bottom: 1px solid rgba(217, 227, 222, 0.9);
    margin-bottom: 2rem;
}

.header-inner,
.section-header,
.nav,
.hero-actions,
.form-actions,
.insight-list {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-inner,
.section-header {
    justify-content: space-between;
    padding: 1rem 0;
}

.brand-lockup {
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    color: inherit;
}

.brand-lockup:hover {
    text-decoration: none;
}

.brand-logo {
    width: 4rem;
    height: 4rem;
    flex: 0 0 auto;
    object-fit: contain;
    object-position: center;
    display: block;
}

.brand-copy {
    min-width: 0;
}

.brand,
h2,
h3,
p {
    margin-top: 0;
}

.brand {
    margin-bottom: 0.15rem;
    font-size: 1.35rem;
    line-height: 1.1;
}

.brand-tagline,
.muted,
small,
.stat-label,
.table-note,
.eyebrow {
    color: var(--color-muted);
}

.brand-tagline {
    margin-bottom: 0;
    font-size: 0.92rem;
}

.nav {
    flex-wrap: wrap;
    justify-content: flex-end;
}

.nav a,
.nav form {
    margin: 0;
}

.nav a {
    padding: 0.5rem 0;
    font-weight: 600;
    color: var(--color-text);
}

.nav a:hover {
    color: var(--color-primary);
}

.nav a.button-secondary {
    padding: 0.75rem 1.5rem;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 2.75rem;
    min-height: 2.75rem;
    padding: 0.5rem;
    border: 1px solid var(--color-border);
    border-radius: 0.5rem;
    background: var(--color-surface-strong);
    color: var(--color-text);
    cursor: pointer;
}

.nav-toggle span {
    display: block;
    width: 1.25rem;
    height: 2px;
    background: currentColor;
    border-radius: 1px;
}

.nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9;
    background: rgba(31, 41, 51, 0.35);
}

body.nav-open .nav-overlay {
    display: block;
}

/* ══════════════════════════════════════════
   COMPONENTS
   ══════════════════════════════════════════ */

.eyebrow {
    margin-bottom: 0.45rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.74rem;
    font-weight: 700;
}

.page-intro {
    margin-bottom: 1.5rem;
}

.hero-panel {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(260px, 1fr);
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.panel {
    background: var(--color-surface-strong);
    border: 1px solid var(--color-border);
    border-radius: 1.25rem;
    padding: 1.5rem;
    box-shadow: var(--shadow-soft);
    margin-bottom: 1.5rem;
}

.panel-subtle {
    background: #fdfefe;
    box-shadow: none;
    border-style: dashed;
    margin-bottom: 0;
}

.panel-highlight {
    background: linear-gradient(180deg, rgba(39, 174, 96, 0.09), rgba(39, 174, 96, 0.03));
    border-color: rgba(39, 174, 96, 0.22);
}

.panel h2,
.panel h3 {
    margin-bottom: 0.65rem;
}

.hero-copy p:last-child,
.panel p:last-child {
    margin-bottom: 0;
}

.auth-panel {
    max-width: 640px;
    margin: 4rem auto;
}

.insight-list {
    flex-wrap: wrap;
    margin-top: 1rem;
}

.insight-pill {
    display: inline-flex;
    align-items: center;
    min-height: 2.25rem;
    padding: 0.4rem 0.8rem;
    border-radius: 999px;
    background: rgba(39, 174, 96, 0.1);
    color: var(--color-primary-dark);
    font-size: 0.92rem;
    font-weight: 600;
}

code {
    overflow-wrap: anywhere;
    padding: 0.18rem 0.4rem;
    border-radius: 0.4rem;
    background: rgba(100, 116, 139, 0.08);
}

/* Stats grid */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.stat-icon {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon-green { background: rgba(39, 174, 96, 0.12); color: #27ae60; }
.stat-icon-blue { background: rgba(59, 130, 246, 0.12); color: #3b82f6; }
.stat-icon-purple { background: rgba(139, 92, 246, 0.12); color: #8b5cf6; }
.stat-icon-amber { background: rgba(245, 158, 11, 0.12); color: #f59e0b; }

.stat-card strong {
    display: block;
    margin-top: 0.15rem;
    font-size: 1.75rem;
    line-height: 1.05;
    font-weight: 700;
}

.stat-label {
    font-size: 0.82rem;
}

/* Dashboard grid */

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.chart-panel {
    margin-bottom: 0;
}

.chart-panel h3 {
    margin-bottom: 1rem;
    font-size: 1rem;
}

/* Filter bar */

.filter-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
    padding: 1rem 1.25rem;
    background: var(--color-surface-strong);
    border: 1px solid var(--color-border);
    border-radius: 1rem;
}

.filter-bar label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--color-muted);
    white-space: nowrap;
}

.filter-bar select,
.filter-bar input[type="text"],
.filter-bar input[type="date"] {
    padding: 0.45rem 0.7rem;
    border: 1px solid var(--color-border);
    border-radius: 0.5rem;
    background: #fff;
    font-size: 0.85rem;
    color: var(--color-text);
}

.filter-bar select:focus,
.filter-bar input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: var(--shadow-focus);
}

.filter-bar button[type="submit"] {
    min-height: auto;
    padding: 0.45rem 1rem;
    font-size: 0.85rem;
    border-radius: 0.5rem;
}

/* Tables */

.table-wrapper {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 0.95rem 0.75rem;
    border-bottom: 1px solid #e8eeeb;
    text-align: left;
    vertical-align: top;
}

thead th {
    color: var(--color-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

tbody tr:hover {
    background: rgba(39, 174, 96, 0.03);
}

/* Forms */

.form-grid {
    display: grid;
    gap: 1rem;
}

.form-grid label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 600;
}

.form-grid input,
.form-grid select,
.form-grid textarea {
    width: 100%;
    padding: 0.85rem 0.95rem;
    border-radius: 0.95rem;
    border: 1px solid var(--color-border-strong);
    background: #fff;
    color: var(--color-text);
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.form-grid input:focus,
.form-grid select:focus,
.form-grid textarea:focus,
button:focus,
.button-secondary:focus,
.link-button:focus,
a:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: var(--shadow-focus);
}

.form-grid textarea {
    min-height: 8rem;
    resize: vertical;
}

.form-actions {
    flex-wrap: wrap;
}

.admin-form input[type="checkbox"] {
    width: auto;
    margin-right: 0.5rem;
}

.error {
    color: var(--color-danger);
    margin-top: 0.35rem;
    margin-bottom: 0;
}

/* Messages */

.message {
    margin-bottom: 1rem;
    padding: 0.9rem 1rem;
    border-radius: 1rem;
    background: var(--color-success-surface);
    border: 1px solid var(--color-success-border);
}

.message-error {
    background: #fef3f2;
    border-color: #f3c7c3;
}

/* ══════════════════════════════════════════
   MARKETING / LANDING PAGE
   ══════════════════════════════════════════ */

.landing-page .site-main {
    padding-bottom: 0;
}

.nav-public {
    align-items: center;
}

.landing-hero,
.landing-section {
    padding: 4rem 0;
}

.landing-section-tight {
    padding-top: 0;
}

.landing-hero {
    padding-top: 1.5rem;
}

.simple-page-hero {
    padding: 3rem 0 2rem;
}

.simple-page-shell {
    width: min(760px, 100%);
}

.landing-grid,
.product-preview,
.pilot-panel,
.privacy-panel {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 1.5rem;
    align-items: center;
}

.hero-content,
.section-heading,
.section-heading-left {
    max-width: 42rem;
}

.hero-content {
    grid-column: span 5;
}

.hero-title {
    margin-bottom: 1.25rem;
    font-size: clamp(2.5rem, 5vw, 3rem);
    line-height: 1.05;
    letter-spacing: -0.03em;
}

.hero-lead,
.section-heading p {
    font-size: 1.05rem;
    color: var(--color-muted);
}

.hero-visual-wrap {
    grid-column: 7 / -1;
}

.hero-visual,
.product-visual {
    position: relative;
    overflow: hidden;
    padding: 1rem;
    border-radius: 1.5rem;
}

.hero-visual img,
.product-visual img {
    width: 100%;
    border-radius: 1rem;
    border: 1px solid rgba(217, 227, 222, 0.9);
}

.mockup-badges {
    position: absolute;
    top: 1.25rem;
    left: 1.25rem;
    right: 1.25rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    pointer-events: none;
}

.mockup-badge {
    display: inline-flex;
    align-items: center;
    min-height: 2rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(217, 227, 222, 0.9);
    box-shadow: 0 8px 24px rgba(31, 41, 51, 0.08);
    color: var(--color-text);
    font-size: 0.85rem;
    font-weight: 600;
}

.hero-kpis,
.trust-grid,
.card-grid,
.impact-grid,
.privacy-grid,
.content-grid {
    display: grid;
    gap: 1rem;
}

.hero-kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 2rem;
}

.hero-kpi {
    margin-bottom: 0;
}

.section-heading {
    margin: 0 auto 2rem;
    text-align: center;
}

.section-heading-left {
    margin-bottom: 0;
    text-align: left;
}

.section-heading h2,
.pilot-panel h2 {
    margin-bottom: 0.85rem;
    font-size: clamp(2rem, 3vw, 2rem);
    line-height: 1.12;
}

.trust-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.card-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.card-grid-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.content-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.content-grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.marketing-card,
.trust-card,
.impact-card,
.content-card {
    margin-bottom: 0;
}

.trust-card {
    text-align: center;
}

.icon-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border-radius: 0.9rem;
    background: rgba(39, 174, 96, 0.12);
    color: var(--color-primary-dark);
    font-size: 0.9rem;
    font-weight: 700;
}

.marketing-card .icon-chip,
.trust-card .icon-chip {
    margin-bottom: 1rem;
}

.marketing-card h3,
.trust-card h3,
.privacy-item h3 {
    margin-bottom: 0.65rem;
    font-size: 1.25rem;
}

.marketing-card p,
.trust-card p,
.privacy-item p,
.footer-brand-text {
    color: var(--color-muted);
}

.product-preview > :first-child {
    grid-column: span 4;
}

.product-visual {
    grid-column: span 8;
}

.preview-list {
    margin: 1.5rem 0 0;
    padding: 0;
    list-style: none;
    color: var(--color-muted);
}

.preview-list li {
    position: relative;
    padding-left: 1.25rem;
    margin-bottom: 0.75rem;
}

.preview-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.55rem;
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 999px;
    background: var(--color-primary);
}

.privacy-panel > :first-child {
    grid-column: span 4;
}

.privacy-grid {
    grid-column: span 8;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.privacy-item {
    padding: 1.5rem;
    border: 1px solid var(--color-border);
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.75);
}

.impact-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.impact-card {
    text-align: center;
}

.impact-card strong {
    display: block;
    margin-bottom: 0.5rem;
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1;
}

.pilot-panel > :first-child {
    grid-column: span 8;
}

.pilot-panel > .button-primary {
    justify-self: end;
}

.site-footer {
    margin-top: 3rem;
    padding: 2rem 0 3rem;
    border-top: 1px solid var(--color-border);
    background: rgba(255, 255, 255, 0.85);
}

.footer-inner,
.footer-links {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.footer-links {
    flex-wrap: wrap;
}

.footer-brand-text {
    margin-bottom: 0;
}

/* ══════════════════════════════════════════
   DETAIL PAGES
   ══════════════════════════════════════════ */

.intervention-meta {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-top: .5rem;
    flex-wrap: wrap;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: .25rem .7rem;
    border-radius: 999px;
    font-size: .8rem;
    font-weight: 600;
    text-transform: capitalize;
}

.status-draft {
    background: rgba(100, 116, 139, .12);
    color: var(--color-muted);
}

.status-active {
    background: rgba(39, 174, 96, .12);
    color: var(--color-primary-dark);
}

.status-completed {
    background: rgba(59, 130, 246, .12);
    color: #2563eb;
}

.status-archived {
    background: rgba(100, 116, 139, .08);
    color: var(--color-muted);
}

.cta-bar {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    margin-top: 1.25rem;
}

.measurement-stats {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-top: .75rem;
}

.empty-state {
    padding: 1.5rem 0;
    text-align: center;
}

.empty-state .muted {
    margin-bottom: 1rem;
}

.copy-toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    padding: .75rem 1.5rem;
    border-radius: 999px;
    background: var(--color-text);
    color: #fff;
    font-weight: 600;
    font-size: .9rem;
    z-index: 100;
    box-shadow: 0 8px 24px rgba(31, 41, 51, .15);
}

.questionnaire-card {
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    margin-bottom: .75rem;
    background: #fff;
}

.questionnaire-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .5rem;
}

.questionnaire-card-actions {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
}

.button-small {
    padding: .35rem .75rem;
    font-size: .85rem;
}

.qr-panel {
    text-align: center;
    padding: 1rem 0 .5rem;
}

.qr-image {
    max-width: 220px;
    width: 100%;
    height: auto;
    border-radius: 8px;
}

/* ══════════════════════════════════════════
   SURVEY FORM (Public)
   ══════════════════════════════════════════ */

.survey-wrapper {
    max-width: 680px;
    margin: 0 auto;
}

.survey-header {
    text-align: center;
    margin-bottom: 2rem;
}

.survey-header h2 {
    margin-bottom: 0.35rem;
    font-size: 1.5rem;
}

.survey-badge {
    display: inline-block;
    margin-top: 0.75rem;
    padding: 0.3rem 0.85rem;
    background: rgba(39, 174, 96, 0.08);
    color: var(--color-primary-dark);
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* ── Question card ── */

.survey-question {
    display: flex;
    gap: 1rem;
    padding: 1.5rem;
    margin-bottom: 0.75rem;
    background: var(--color-surface-strong);
    border: 1px solid var(--color-border);
    border-radius: 1.25rem;
    box-shadow: var(--shadow-soft);
    transition: border-color 0.2s ease;
}

.survey-question:focus-within {
    border-color: rgba(39, 174, 96, 0.4);
}

.survey-q--error {
    border-color: var(--color-danger) !important;
}

.survey-q-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: rgba(39, 174, 96, 0.1);
    color: var(--color-primary-dark);
    font-weight: 700;
    font-size: 0.82rem;
    flex-shrink: 0;
}

.survey-q-body {
    flex: 1;
    min-width: 0;
}

.survey-q-label {
    font-weight: 600;
    font-size: 1rem;
    line-height: 1.45;
    margin-bottom: 0.85rem;
}

.survey-required {
    color: var(--color-danger);
}

.survey-q-help {
    color: var(--color-muted);
    font-size: 0.85rem;
    margin-top: -0.5rem;
    margin-bottom: 0.85rem;
}

.survey-q-error {
    color: var(--color-danger);
    font-size: 0.85rem;
    margin-top: 0.5rem;
    margin-bottom: 0;
}

/* ── Hide native radio/checkbox ── */

.survey-question input[type="radio"],
.survey-question input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

/* ── Scale 1-5: horizontal numbered circles ── */

.survey-q--scale_1_5 .survey-q-input > div {
    display: flex;
    gap: 0.6rem;
}

.survey-q--scale_1_5 .survey-q-input > div > div {
    flex: 1;
}

.survey-q--scale_1_5 .survey-q-input > div > div > label {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    aspect-ratio: 1;
    max-width: 3.5rem;
    margin: 0 auto;
    border: 2px solid var(--color-border);
    border-radius: 50%;
    cursor: pointer;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--color-muted);
    transition: all 0.15s ease;
    user-select: none;
}

.survey-q--scale_1_5 .survey-q-input > div > div > label:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    background: rgba(39, 174, 96, 0.04);
}

.survey-q--scale_1_5 .survey-q-input > div > div > label:has(input:checked) {
    border-color: var(--color-primary);
    background: var(--color-primary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(39, 174, 96, 0.25);
}

/* ── Yes/No: horizontal pill toggles ── */

.survey-q--yes_no .survey-q-input > div {
    display: flex;
    gap: 0.6rem;
}

.survey-q--yes_no .survey-q-input > div > div {
    flex: 1;
    max-width: 160px;
}

.survey-q--yes_no .survey-q-input > div > div > label {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border: 2px solid var(--color-border);
    border-radius: 999px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--color-text);
    transition: all 0.15s ease;
    user-select: none;
}

.survey-q--yes_no .survey-q-input > div > div > label:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.survey-q--yes_no .survey-q-input > div > div > label:has(input:checked) {
    border-color: var(--color-primary);
    background: var(--color-primary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(39, 174, 96, 0.25);
}

/* ── Single choice: option cards with radio indicator ── */

.survey-q--single_choice .survey-q-input > div > div {
    margin-bottom: 0.4rem;
}

.survey-q--single_choice .survey-q-input > div > div:last-child {
    margin-bottom: 0;
}

.survey-q--single_choice .survey-q-input > div > div > label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.8rem 1rem;
    border: 1.5px solid var(--color-border);
    border-radius: 0.85rem;
    cursor: pointer;
    font-weight: 500;
    color: var(--color-text);
    transition: all 0.15s ease;
    user-select: none;
}

.survey-q--single_choice .survey-q-input > div > div > label::before {
    content: "";
    width: 1.15rem;
    height: 1.15rem;
    border: 2px solid var(--color-border-strong);
    border-radius: 50%;
    flex-shrink: 0;
    transition: all 0.15s ease;
}

.survey-q--single_choice .survey-q-input > div > div > label:hover {
    border-color: var(--color-primary);
    background: rgba(39, 174, 96, 0.02);
}

.survey-q--single_choice .survey-q-input > div > div > label:has(input:checked) {
    border-color: var(--color-primary);
    background: rgba(39, 174, 96, 0.05);
}

.survey-q--single_choice .survey-q-input > div > div > label:has(input:checked)::before {
    border-color: var(--color-primary);
    background: var(--color-primary);
    box-shadow: inset 0 0 0 3px #fff;
}

/* ── Multiple choice: option cards with checkbox indicator ── */

.survey-q--multiple_choice .survey-q-input > div > div {
    margin-bottom: 0.4rem;
}

.survey-q--multiple_choice .survey-q-input > div > div:last-child {
    margin-bottom: 0;
}

.survey-q--multiple_choice .survey-q-input > div > div > label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.8rem 1rem;
    border: 1.5px solid var(--color-border);
    border-radius: 0.85rem;
    cursor: pointer;
    font-weight: 500;
    color: var(--color-text);
    transition: all 0.15s ease;
    user-select: none;
}

.survey-q--multiple_choice .survey-q-input > div > div > label::before {
    content: "";
    width: 1.15rem;
    height: 1.15rem;
    border: 2px solid var(--color-border-strong);
    border-radius: 0.3rem;
    flex-shrink: 0;
    transition: all 0.15s ease;
}

.survey-q--multiple_choice .survey-q-input > div > div > label:hover {
    border-color: var(--color-primary);
    background: rgba(39, 174, 96, 0.02);
}

.survey-q--multiple_choice .survey-q-input > div > div > label:has(input:checked) {
    border-color: var(--color-primary);
    background: rgba(39, 174, 96, 0.05);
}

.survey-q--multiple_choice .survey-q-input > div > div > label:has(input:checked)::before {
    border-color: var(--color-primary);
    background: var(--color-primary);
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 14 14' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3 7l3 3 5-6' stroke='white' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-size: 75%;
    background-position: center;
    background-repeat: no-repeat;
}

/* ── Text & Numeric inputs ── */

.survey-question input[type="number"],
.survey-question textarea {
    width: 100%;
    padding: 0.85rem 1rem;
    border: 1.5px solid var(--color-border);
    border-radius: 0.85rem;
    background: #fff;
    color: var(--color-text);
    font: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.survey-question input[type="number"]:focus,
.survey-question textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: var(--shadow-focus);
}

.survey-question textarea {
    min-height: 5rem;
    resize: vertical;
}

.survey-question input[type="number"] {
    max-width: 160px;
}

/* ── Submit area ── */

.survey-submit {
    text-align: center;
    padding: 1.5rem 0 1rem;
}

.survey-submit button {
    min-width: 200px;
    padding: 1rem 2rem;
    font-size: 1.05rem;
}

.survey-privacy-note {
    margin-top: 0.75rem;
    font-size: 0.82rem;
}

/* ══════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════ */

@media (max-width: 780px) {
    /* Sidebar: slide-out on mobile */
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.25s ease;
    }

    body.sidebar-open .sidebar {
        transform: translateX(0);
    }

    .app-main {
        margin-left: 0;
    }

    .topbar-toggle {
        display: flex;
    }

    .topbar {
        padding: 0.65rem 1rem;
    }

    .main-content {
        padding: 1.25rem 1rem 2rem;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    /* Classic header (public) */
    .header-inner {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
        align-items: center;
    }

    .nav-toggle {
        display: flex;
    }

    .nav-drawer {
        display: none;
        position: fixed;
        top: 5rem;
        left: 0;
        right: 0;
        z-index: 10;
        flex-direction: column;
        background: var(--color-surface-strong);
        border-bottom: 1px solid var(--color-border);
        padding: 1rem 0;
        max-height: calc(100vh - 5rem);
        overflow-y: auto;
    }

    body.nav-open .nav-drawer {
        display: flex;
    }

    .nav-drawer a {
        min-height: 3rem;
        padding: 1rem 1.25rem;
        border-radius: 0;
        border-bottom: 1px solid var(--color-border);
        display: flex;
        align-items: center;
    }

    .nav-drawer a:last-child {
        border-bottom: 0;
    }

    .nav-drawer a.button-secondary {
        margin: 0.75rem 1.25rem 0;
        justify-content: center;
        min-height: 3rem;
    }

    .nav-drawer form {
        margin: 0;
        padding: 1rem 1.25rem;
        border-bottom: 1px solid var(--color-border);
    }

    .nav-drawer form:last-child {
        border-bottom: 0;
    }

    .section-header,
    .hero-panel {
        display: block;
    }

    .auth-panel {
        margin: 2rem auto 3rem;
    }

    .landing-hero,
    .landing-section {
        padding: 3rem 0;
    }

    .landing-grid,
    .product-preview,
    .pilot-panel,
    .privacy-panel {
        display: block;
    }

    .hero-kpis,
    .trust-grid,
    .card-grid-3,
    .card-grid-4,
    .impact-grid,
    .privacy-grid,
    .content-grid,
    .content-grid-2 {
        grid-template-columns: 1fr;
    }

    .hero-visual-wrap,
    .product-visual {
        margin-top: 1.5rem;
    }

    .mockup-badges {
        position: static;
        margin-bottom: 1rem;
    }

    .pilot-panel > .button-primary {
        justify-self: start;
        margin-top: 1rem;
    }

    .footer-inner {
        display: block;
    }

    .filter-bar {
        gap: 0.5rem;
    }

    /* Survey responsive */
    .survey-question {
        padding: 1.25rem 1rem;
        gap: 0.75rem;
    }

    .survey-q--scale_1_5 .survey-q-input > div {
        gap: 0.35rem;
    }

    .survey-q--scale_1_5 .survey-q-input > div > div > label {
        font-size: 0.95rem;
    }

    .survey-q--yes_no .survey-q-input > div > div {
        max-width: none;
    }
}

@media (max-width: 480px) {
    .brand-copy .eyebrow,
    .brand-copy .brand-tagline {
        display: none;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
}
