/* ==========================================================================
   heknowel - one stylesheet for admin, public and capture form screens.
   Lightweight by design: Bootstrap 5 handles the grid and components,
   this file provides the brand layer. No build step, no framework.
   ========================================================================== */

:root {
    --ink: #0b1220;
    --ink-soft: #1c2740;
    --text: #1e293b;
    --muted: #64748b;
    --muted-2: #8792a6;
    --line: #e6e9f0;
    --line-soft: #eef1f7;
    --bg: #f5f7fb;
    --surface: #ffffff;
    --brand: #4f46e5;
    --brand-dark: #4338ca;
    --brand-soft: #eef0ff;
    --teal: #0f9f8f;
    --green: #059669;
    --amber: #d97706;
    --rose: #e11d48;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
    --shadow-md: 0 20px 45px -28px rgba(15, 23, 42, .35);
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    font-family: var(--font);
    -webkit-font-smoothing: antialiased;
    color: var(--text);
}

a {
    color: var(--brand);
}

a:hover {
    color: var(--brand-dark);
}

code {
    color: #4338ca;
    background: #f1f3fb;
    padding: 1px 5px;
    border-radius: 4px;
    font-size: .85em;
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.btn {
    border-radius: 10px;
    font-weight: 600;
    font-size: .875rem;
    padding: .52rem .95rem;
}

.btn-lg {
    padding: .72rem 1.2rem;
    font-size: .95rem;
}

.btn-sm {
    padding: .35rem .7rem;
    font-size: .8rem;
    border-radius: 8px;
}

.btn-brand {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
    box-shadow: 0 1px 2px rgba(79, 70, 229, .2);
}

.btn-brand:hover,
.btn-brand:focus {
    background: var(--brand-dark);
    border-color: var(--brand-dark);
    color: #fff;
}

.btn-brand:disabled {
    background: #a5a9f8;
    border-color: #a5a9f8;
    color: #fff;
}

.btn-light {
    background: #f3f5fa;
    border-color: #f3f5fa;
    color: #334155;
}

.btn-light:hover {
    background: #e9edf6;
    border-color: #e9edf6;
    color: #0f172a;
}

.btn-outline-secondary {
    border-color: #d8deea;
    color: #334155;
}

.btn-outline-secondary:hover {
    background: #f3f5fa;
    border-color: #cbd5e1;
    color: #0f172a;
}

.btn-icon {
    width: 38px;
    height: 38px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
}

.btn-ghost-light {
    background: transparent;
    border: 0;
    color: #93a1b8;
}

.btn-ghost-light:hover {
    background: #18233a;
    color: #fff;
}

.brand-mark {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, #6366f1, #4338ca);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex: 0 0 auto;
    box-shadow: 0 6px 14px -8px rgba(67, 56, 202, .9);
}

/* --------------------------------------------------------------------------
   Admin shell
   -------------------------------------------------------------------------- */

.admin-body {
    background: var(--bg);
    min-height: 100vh;
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 258px;
    background: var(--ink);
    color: #aab6c9;
    padding: 20px 14px 16px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    z-index: 1045;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 11px;
    color: #fff;
    text-decoration: none;
    padding: 6px 8px 22px;
}

.sidebar-brand:hover {
    color: #fff;
}

.sidebar-brand strong {
    display: block;
    font-size: .98rem;
    letter-spacing: -.01em;
    line-height: 1.2;
}

.sidebar-brand small {
    display: block;
    color: #6f7d95;
    font-size: .72rem;
    margin-top: 2px;
}

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

.sidebar-label {
    font-size: .66rem;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: #5c6b84;
    padding: 0 12px;
    margin: 8px 0 8px;
    display: block;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    color: #aab6c9;
    text-decoration: none;
    font-size: .88rem;
    font-weight: 500;
    margin-bottom: 2px;
    transition: background .15s ease, color .15s ease;
}

.sidebar-link i {
    font-size: 1rem;
    width: 18px;
    text-align: center;
    color: #7d8ba3;
}

.sidebar-link:hover {
    background: #131e33;
    color: #fff;
}

.sidebar-link:hover i {
    color: #c7d2fe;
}

.sidebar-link.active {
    background: #18233a;
    color: #fff;
    box-shadow: inset 3px 0 0 #6366f1;
}

.sidebar-link.active i {
    color: #a5b4fc;
}

.sidebar-user {
    margin-top: auto;
    border-top: 1px solid #1b263c;
    padding: 14px 6px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-user-info {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-width: 0;
    line-height: 1.25;
}

.sidebar-user-info strong {
    color: #fff;
    font-size: .83rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-info small {
    color: #7f8ca3;
    font-size: .72rem;
}

.sidebar-backdrop {
    display: none;
}

.app-main {
    margin-left: 258px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 1030;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 13px 28px;
}

.topbar-title {
    min-width: 0;
}

.topbar-title h1 {
    font-size: 1.05rem;
    font-weight: 650;
    letter-spacing: -.01em;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topbar-title p {
    margin: 1px 0 0;
    font-size: .78rem;
    color: var(--muted);
}

.topbar-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
}

.app-content {
    padding: 26px 28px 44px;
    flex: 1 1 auto;
    width: 100%;
    max-width: 1440px;
}

/* --------------------------------------------------------------------------
   Page heading
   -------------------------------------------------------------------------- */

.page-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.page-title {
    font-size: 1.42rem;
    font-weight: 700;
    letter-spacing: -.025em;
    margin: 0;
    color: var(--ink);
}

.page-sub {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: .875rem;
}

.page-sub a {
    color: var(--brand);
    text-decoration: none;
}

.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .76rem;
    color: var(--muted-2);
    margin-bottom: 6px;
}

.breadcrumbs a {
    color: var(--muted);
    text-decoration: none;
}

.breadcrumbs a:hover {
    color: var(--brand);
}

.breadcrumbs i {
    font-size: .6rem;
}

/* --------------------------------------------------------------------------
   Panels & statistics
   -------------------------------------------------------------------------- */

.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px 22px;
    box-shadow: var(--shadow-sm);
}

.panel-flush {
    padding: 0;
    overflow: hidden;
}

.panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
}

.panel-head-pad {
    padding: 20px 22px 0;
    margin-bottom: 8px;
}

.panel-head h3 {
    font-size: .98rem;
    font-weight: 650;
    margin: 0;
    letter-spacing: -.01em;
    color: var(--ink);
}

.panel-head p {
    margin: 2px 0 0;
    font-size: .78rem;
    color: var(--muted);
}

.panel-foot {
    padding: 14px 22px 18px;
    border-top: 1px solid var(--line-soft);
}

.panel-filter {
    padding: 16px 18px;
    margin-bottom: 16px;
}

.panel-danger {
    border-color: #f7d4dc;
    background: #fffafb;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #f4f6fb;
    color: #475569;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: .72rem;
    font-weight: 600;
    white-space: nowrap;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px 20px;
    box-shadow: var(--shadow-sm);
    height: 100%;
}

.stat-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.stat-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
}

.stat-icon.indigo {
    background: #eef0ff;
    color: #4338ca;
}

.stat-icon.teal {
    background: #e6faf6;
    color: #0f766e;
}

.stat-icon.amber {
    background: #fff6e6;
    color: #b45309;
}

.stat-icon.green {
    background: #e8f9f0;
    color: #047857;
}

.stat-trend {
    font-size: .7rem;
    font-weight: 700;
    color: #047857;
    background: #ecfdf5;
    border-radius: 999px;
    padding: 3px 8px;
    white-space: nowrap;
}

.stat-trend.down {
    color: #be123c;
    background: #fff1f3;
}

.stat-value {
    font-size: 1.85rem;
    font-weight: 700;
    letter-spacing: -.03em;
    margin-top: 14px;
    color: var(--ink);
    line-height: 1.1;
}

.stat-label {
    font-size: .8rem;
    color: var(--muted);
    margin-top: 2px;
}

/* Chart (pure CSS bars, no chart library) */

.chart {
    display: flex;
    align-items: stretch;
    gap: 6px;
    height: 200px;
    padding-top: 12px;
    border-bottom: 1px solid var(--line-soft);
}

.chart-bar-wrap {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    gap: 7px;
}

.chart-bar {
    width: 100%;
    max-width: 26px;
    background: linear-gradient(180deg, #818cf8, #4f46e5);
    border-radius: 5px 5px 2px 2px;
    opacity: .88;
    transition: opacity .15s ease;
    min-height: 4px;
}

.chart-bar-wrap:hover .chart-bar {
    opacity: 1;
}

.chart-label {
    font-size: .62rem;
    color: #8993a6;
}

/* Breakdown bars */

.breakdown {
    display: flex;
    flex-direction: column;
}

.breakdown-row {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 7px 0;
    font-size: .82rem;
    color: inherit;
    text-decoration: none;
}

.breakdown-row:hover {
    color: inherit;
}

.breakdown-label {
    flex: 0 0 74px;
    color: #45526b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.breakdown-bar {
    flex: 1 1 auto;
    height: 6px;
    background: #eef1f7;
    border-radius: 999px;
    overflow: hidden;
}

.breakdown-bar > span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #818cf8, #4f46e5);
    border-radius: 999px;
    min-width: 2px;
}

.breakdown-row strong {
    width: 30px;
    text-align: right;
    font-size: .78rem;
    color: var(--ink);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex: 0 0 auto;
    background: #94a3b8;
}

.status-dot.status-new { background: #64748b; }
.status-dot.status-contacted { background: #0ea5e9; }
.status-dot.status-qualified { background: #6366f1; }
.status-dot.status-won { background: #10b981; }
.status-dot.status-lost { background: #f43f5e; }
.status-dot.status-spam { background: #334155; }

.source-dot {
    width: 8px;
    height: 8px;
    border-radius: 2px;
    background: #a5b4fc;
    flex: 0 0 auto;
}

/* Simple list */

.simple-list {
    display: flex;
    flex-direction: column;
}

.simple-list-row {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 0;
    border-bottom: 1px solid var(--line-soft);
    color: inherit;
    text-decoration: none;
    font-size: .85rem;
}

.simple-list-row:last-child {
    border-bottom: 0;
}

.simple-list-row:hover {
    color: var(--brand);
}

.simple-list-icon {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: #f4f6fb;
    color: #6366f1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.simple-list-row strong {
    display: block;
    font-size: .84rem;
    color: var(--ink);
}

.simple-list-row small {
    display: block;
    color: var(--muted);
    font-size: .72rem;
}

.simple-list-row i.bi-chevron-right {
    color: #b6c0d1;
    font-size: .7rem;
}

/* --------------------------------------------------------------------------
   Tables
   -------------------------------------------------------------------------- */

.table-clean {
    margin: 0;
    --bs-table-bg: transparent;
    --bs-table-hover-bg: #fafbff;
    font-size: .875rem;
}

.table-clean thead th {
    background: #fbfcfe;
    border-bottom: 1px solid var(--line);
    border-top: 0;
    color: #7c8798;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
    padding: 12px 16px;
    white-space: nowrap;
}

.table-clean tbody td {
    border-bottom: 1px solid #f1f3f8;
    padding: 13px 16px;
    vertical-align: middle;
}

.table-clean tbody tr:last-child td {
    border-bottom: 0;
}

.table-clean tbody tr:hover {
    background: #fafbff;
}

.lead-cell {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
    min-width: 190px;
}

.lead-cell:hover {
    color: inherit;
}

.lead-cell strong {
    display: block;
    font-size: .85rem;
    font-weight: 600;
    color: var(--ink);
    line-height: 1.3;
}

.lead-cell small {
    display: block;
    font-size: .75rem;
    color: var(--muted);
    line-height: 1.3;
}

.avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .02em;
    flex: 0 0 auto;
    text-transform: uppercase;
}

.avatar-sm {
    width: 32px;
    height: 32px;
    font-size: .72rem;
}

.badge {
    font-weight: 600;
    font-size: .7rem;
    padding: .35em .65em;
    border-radius: 6px;
    letter-spacing: .01em;
}

.badge-soft-primary { background: #eef0ff; color: #4338ca; }
.badge-soft-secondary { background: #f1f5f9; color: #475569; }
.badge-soft-info { background: #e6f6ff; color: #0369a1; }
.badge-soft-success { background: #e7f8f0; color: #047857; }
.badge-soft-danger { background: #fdecef; color: #be123c; }
.badge-soft-dark { background: #eef1f6; color: #334155; }

.status-tabs {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 4px;
    margin-bottom: 14px;
}

.status-tab {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 12px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid var(--line);
    color: #475569;
    font-size: .8rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.status-tab span {
    background: #f1f5f9;
    color: #64748b;
    border-radius: 999px;
    padding: 1px 7px;
    font-size: .68rem;
}

.status-tab:hover {
    border-color: #c7d2fe;
    color: var(--brand);
}

.status-tab.active {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

.status-tab.active span {
    background: rgba(255, 255, 255, .22);
    color: #fff;
}

/* --------------------------------------------------------------------------
   Forms (admin)
   -------------------------------------------------------------------------- */

.form-label {
    font-size: .825rem;
    font-weight: 600;
    color: #26324a;
    margin-bottom: 5px;
}

.req {
    color: var(--rose);
}

.form-control,
.form-select {
    border-color: #dfe4ee;
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: .875rem;
    padding: .55rem .75rem;
    box-shadow: none;
}

.form-control:focus,
.form-select:focus {
    border-color: #a5a9f8;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, .1);
}

.form-control-sm,
.form-select-sm {
    font-size: .8rem;
    padding: .35rem .55rem;
    border-radius: 8px;
}

.form-check-input {
    border-color: #cbd5e1;
}

.form-check-input:checked {
    background-color: var(--brand);
    border-color: var(--brand);
}

.form-check-input:focus {
    border-color: #a5a9f8;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, .12);
}

.form-text {
    font-size: .76rem;
    color: var(--muted);
}

.input-icon {
    position: relative;
}

.input-icon > i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #9aa5b8;
    font-size: .9rem;
    pointer-events: none;
}

.input-icon .form-control {
    padding-left: 36px;
}

.code-block {
    background: var(--ink);
    color: #cbd5e1;
    border-radius: 10px;
    padding: 11px 13px;
    font-size: .76rem;
    overflow-x: auto;
    word-break: break-all;
    line-height: 1.7;
}

.code-block code {
    background: transparent;
    color: #a5b4fc;
    padding: 0;
}

.soft-divider {
    border-color: var(--line-soft);
    margin: 18px 0;
    opacity: 1;
}

.meta-label {
    display: block;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: #8792a6;
}

.meta-value {
    font-size: .9rem;
    color: var(--ink);
    margin: 3px 0 0;
    word-break: break-word;
}

.meta-value a {
    text-decoration: none;
}

.lead-message {
    background: #f8fafc;
    border: 1px solid #eef1f7;
    border-radius: 10px;
    padding: 12px 14px;
    margin-top: 7px;
    font-size: .89rem;
    color: #334155;
    line-height: 1.65;
}

.detail-list {
    margin: 0;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 14px;
    padding: 8px 0;
    border-bottom: 1px dashed var(--line-soft);
    font-size: .82rem;
}

.detail-row:last-child {
    border-bottom: 0;
}

.detail-row dt {
    font-weight: 500;
    color: #7b8698;
    flex: 0 0 auto;
}

.detail-row dd {
    margin: 0;
    color: var(--ink);
    text-align: right;
    word-break: break-word;
    max-width: 70%;
}

/* Attachments */

.attachment-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.attachment {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 11px;
    border: 1px solid var(--line);
    border-radius: 10px;
    color: inherit;
    text-decoration: none;
    transition: border-color .15s ease, background .15s ease;
}

.attachment:hover {
    border-color: #c7d2fe;
    background: #fafbff;
    color: inherit;
}

.attachment-icon {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: #f1f3fb;
    color: #4f46e5;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.attachment strong {
    display: block;
    font-size: .82rem;
    color: var(--ink);
}

.attachment small {
    display: block;
    font-size: .72rem;
    color: var(--muted);
}

/* Timeline & history */

.timeline {
    display: flex;
    flex-direction: column;
}

.note-item {
    display: flex;
    gap: 11px;
    padding: 14px 0;
    border-bottom: 1px solid var(--line-soft);
}

.note-item:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.note-body {
    flex: 1 1 auto;
    min-width: 0;
}

.note-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .76rem;
}

.note-meta strong {
    color: var(--ink);
    font-size: .8rem;
}

.note-meta span {
    color: var(--muted-2);
}

.note-text {
    margin: 4px 0 0;
    font-size: .86rem;
    color: #334155;
    line-height: 1.6;
}

.history-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.history-list li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 9px 0;
    border-bottom: 1px solid var(--line-soft);
    font-size: .8rem;
}

.history-list li:last-child {
    border-bottom: 0;
}

.history-icon {
    width: 26px;
    height: 26px;
    border-radius: 7px;
    background: #f1f3fb;
    color: #6366f1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .7rem;
    flex: 0 0 auto;
}

.history-list strong {
    display: block;
    font-size: .78rem;
    text-transform: capitalize;
    color: var(--ink);
}

.history-list small {
    display: block;
    color: var(--muted);
    font-size: .75rem;
}

.history-time {
    margin-left: auto;
    font-size: .72rem;
    color: var(--muted-2);
    white-space: nowrap;
}

/* Empty states */

.empty-state {
    padding: 52px 24px;
    text-align: center;
}

.empty-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: var(--brand-soft);
    color: var(--brand);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin-bottom: 14px;
}

.empty-state h4 {
    font-size: 1.05rem;
    font-weight: 650;
    color: var(--ink);
    margin-bottom: 6px;
}

.empty-state p {
    color: var(--muted);
    font-size: .86rem;
    max-width: 420px;
    margin: 0 auto 16px;
}

.empty-inline {
    padding: 30px 10px;
    text-align: center;
    color: var(--muted);
}

.empty-inline i {
    font-size: 1.5rem;
    color: #b6c0d1;
    display: block;
    margin-bottom: 6px;
}

.empty-inline p {
    margin: 0;
    font-size: .83rem;
}

/* Forms list cards */

.form-stats {
    display: flex;
    gap: 26px;
    padding: 12px 0 4px;
    border-top: 1px solid var(--line-soft);
    border-bottom: 1px solid var(--line-soft);
    margin-bottom: 12px;
}

.form-stats strong {
    display: block;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--ink);
    line-height: 1.2;
}

.form-stats span {
    display: block;
    font-size: .7rem;
    color: var(--muted);
}

/* Field builder */

.field-row {
    background: #fbfcfe;
    border: 1px solid #e9edf5;
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 10px;
}

.field-row-title {
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #8792a6;
}

.field-row .form-label {
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #8792a6;
    font-weight: 600;
    margin-bottom: 3px;
}

.field-row .form-check-label {
    font-size: .8rem;
    color: #475569;
}

/* Activity tags */

.activity-tag {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-size: .76rem;
    padding: 3px 8px;
    background: #f1f5f9;
    border-radius: 6px;
    color: #334155;
    text-transform: capitalize;
    white-space: nowrap;
}

.activity-tag i {
    color: var(--brand);
    font-size: 1rem;
    line-height: 1;
}

/* Alerts */

.app-alert {
    border-radius: 12px;
    font-size: .85rem;
    border: 0;
    padding: 12px 14px;
}

.alert-success {
    background: #eafaf2;
    color: #065f46;
}

.alert-danger {
    background: #fdeef1;
    color: #9f1239;
}

.alert-warning {
    background: #fff7e6;
    color: #92400e;
}

/* Pagination */

.pagination .page-link {
    border: 0;
    color: #475569;
    border-radius: 8px;
    margin: 0 2px;
    min-width: 32px;
    text-align: center;
    font-size: .8rem;
}

.pagination .page-item.active .page-link {
    background: var(--brand);
    color: #fff;
}

.pagination .page-item.disabled .page-link {
    color: #c1c9d6;
    background: transparent;
}

/* --------------------------------------------------------------------------
   Authentication
   -------------------------------------------------------------------------- */

.auth-body {
    background: #f6f7fb;
    min-height: 100vh;
}

.auth-shell {
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    min-height: 100vh;
}

.auth-aside {
    background: linear-gradient(150deg, #0b1220 0%, #1e1b4b 55%, #312e81 100%);
    color: #fff;
    padding: 42px 46px;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.auth-aside::before {
    content: "";
    position: absolute;
    width: 480px;
    height: 480px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(99, 102, 241, .35), transparent 65%);
    top: -160px;
    right: -140px;
}

.auth-aside::after {
    content: "";
    position: absolute;
    width: 380px;
    height: 380px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(16, 185, 129, .18), transparent 65%);
    bottom: -140px;
    left: -100px;
}

.auth-aside .public-brand,
.auth-aside-copy,
.auth-aside-foot {
    position: relative;
    z-index: 1;
}

.auth-aside-copy {
    margin-top: auto;
    max-width: 520px;
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: .12em;
    font-size: .72rem;
    font-weight: 700;
    color: #a5b4fc;
    margin-bottom: 12px;
}

.auth-aside h1 {
    font-size: clamp(2rem, 3.2vw, 2.9rem);
    font-weight: 700;
    letter-spacing: -.035em;
    line-height: 1.08;
    margin: 0 0 16px;
}

.auth-aside p {
    font-size: .95rem;
    line-height: 1.7;
}

.auth-points {
    list-style: none;
    padding: 0;
    margin: 26px 0 0;
    display: grid;
    gap: 10px;
    color: #c7d2fe;
    font-size: .87rem;
}

.auth-points li {
    display: flex;
    align-items: center;
    gap: 9px;
}

.auth-points i {
    color: #34d399;
    font-size: 1rem;
}

.auth-aside-foot {
    margin-top: 32px;
    color: #64748b;
    font-size: .76rem;
}

.auth-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 36px 22px;
}

.auth-card {
    width: 100%;
    max-width: 424px;
    background: #fff;
    border: 1px solid #e7ebf3;
    border-radius: 20px;
    padding: 32px;
    box-shadow: var(--shadow-md);
}

.auth-card-wide {
    max-width: 640px;
}

.auth-head {
    margin-bottom: 22px;
}

.auth-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--brand-soft);
    color: var(--brand);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    margin-bottom: 12px;
}

.auth-head h1 {
    font-size: 1.45rem;
    font-weight: 700;
    letter-spacing: -.02em;
    margin: 0 0 4px;
    color: var(--ink);
}

.auth-head p {
    color: var(--muted);
    font-size: .88rem;
    margin: 0;
}

.auth-form .form-control {
    padding: .62rem .8rem;
}

.auth-hint {
    font-size: .76rem;
    color: #8993a6;
    margin: 18px 0 0;
    text-align: center;
    line-height: 1.6;
}

.auth-foot {
    font-size: .74rem;
    color: #9aa3b5;
    margin: 18px 0 0;
}

.setup-status {
    border: 1px solid var(--line-soft);
    border-radius: 12px;
    padding: 6px 14px;
    margin-bottom: 18px;
    background: #fbfcfe;
}

.setup-status-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
    font-size: .8rem;
    color: var(--muted);
    border-bottom: 1px dashed var(--line-soft);
}

.setup-status-row:last-child {
    border-bottom: 0;
}

.setup-status-row strong {
    color: var(--ink);
    font-weight: 600;
    text-align: right;
    word-break: break-all;
}

/* --------------------------------------------------------------------------
   Public site
   -------------------------------------------------------------------------- */

.public-body {
    background: #fbfcff;
    color: var(--text);
}

.public-nav {
    padding: 16px 0;
    border-bottom: 1px solid var(--line-soft);
    background: rgba(255, 255, 255, .82);
    backdrop-filter: blur(10px);
    position: relative;
    z-index: 5;
}

.public-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--ink);
    text-decoration: none;
    font-weight: 700;
    font-size: 1rem;
}

.public-brand:hover {
    color: var(--ink);
}

.public-main {
    min-height: 60vh;
}

.public-footer {
    padding: 26px 0;
    border-top: 1px solid var(--line-soft);
    color: #7b8698;
    font-size: .82rem;
}

.public-footer a {
    color: #7b8698;
    text-decoration: none;
}

.public-footer a:hover {
    color: var(--brand);
}

.hero {
    padding: 70px 0 64px;
    background:
        radial-gradient(900px 420px at 8% -10%, rgba(99, 102, 241, .14), transparent 60%),
        radial-gradient(760px 400px at 95% 10%, rgba(15, 159, 143, .1), transparent 60%);
}

.hero-title {
    font-size: clamp(2.2rem, 5vw, 3.5rem);
    font-weight: 700;
    letter-spacing: -.04em;
    line-height: 1.05;
    margin: 16px 0 16px;
    color: var(--ink);
}

.hero-copy {
    font-size: 1.05rem;
    line-height: 1.7;
    color: #566179;
    max-width: 33rem;
    margin-bottom: 24px;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: var(--brand-soft);
    color: #4338ca;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: .76rem;
    font-weight: 700;
    letter-spacing: .01em;
}

.hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
    margin-top: 24px;
    color: #64748b;
    font-size: .83rem;
}

.hero-meta span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.hero-meta i {
    color: var(--green);
}

.hero-visual {
    position: relative;
    padding: 8px 14px 26px;
}

.mock-window {
    background: #fff;
    border: 1px solid #e5e9f2;
    border-radius: 18px;
    box-shadow: 0 28px 70px -30px rgba(15, 23, 42, .35);
    overflow: hidden;
}

.mock-bar {
    height: 36px;
    background: #f8fafc;
    border-bottom: 1px solid #eef1f7;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 14px;
}

.mock-bar span {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #e2e8f0;
}

.mock-bar span:first-child { background: #fda4af; }
.mock-bar span:nth-child(2) { background: #fcd34d; }
.mock-bar span:nth-child(3) { background: #86efac; }

.mock-body {
    padding: 22px;
}

.mock-heading {
    font-size: 1.02rem;
    font-weight: 700;
    color: var(--ink);
    letter-spacing: -.01em;
}

.mock-sub {
    font-size: .76rem;
    color: var(--muted);
    margin: 3px 0 16px;
}

.mock-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.mock-input {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    background: #fff;
}

.mock-input span {
    font-size: .58rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #94a3b8;
    font-weight: 700;
}

.mock-input em {
    font-style: normal;
    font-size: .78rem;
    color: #334155;
}

.mock-input.full {
    margin-top: 10px;
}

.mock-button {
    margin-top: 14px;
    background: var(--brand);
    color: #fff;
    border-radius: 10px;
    padding: 11px;
    text-align: center;
    font-weight: 600;
    font-size: .85rem;
}

.mock-toast {
    position: absolute;
    left: 0;
    bottom: 0;
    background: #fff;
    border: 1px solid #e5e9f2;
    border-radius: 14px;
    box-shadow: 0 18px 40px -22px rgba(15, 23, 42, .45);
    padding: 11px 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.mock-toast-icon {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #e7f8f0;
    color: #047857;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.mock-toast strong {
    display: block;
    font-size: .78rem;
    color: var(--ink);
}

.mock-toast small {
    display: block;
    font-size: .7rem;
    color: var(--muted);
}

.section {
    padding: 62px 0;
}

.section-muted {
    background: #f4f6fb;
    border-top: 1px solid #edf0f7;
    border-bottom: 1px solid #edf0f7;
}

.section-head {
    max-width: 640px;
    margin-bottom: 30px;
}

.section-head h2 {
    font-size: clamp(1.6rem, 2.6vw, 2.1rem);
    font-weight: 700;
    letter-spacing: -.03em;
    color: var(--ink);
    margin: 0;
}

.section h2 {
    font-size: clamp(1.55rem, 2.6vw, 2rem);
    font-weight: 700;
    letter-spacing: -.03em;
    color: var(--ink);
}

.feature-card {
    background: #fff;
    border: 1px solid #e8ecf3;
    border-radius: 16px;
    padding: 24px;
    height: 100%;
    box-shadow: var(--shadow-sm);
}

.feature-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--brand-soft);
    color: var(--brand);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    margin-bottom: 14px;
}

.feature-card h3 {
    font-size: 1.02rem;
    font-weight: 650;
    color: var(--ink);
    margin-bottom: 7px;
}

.feature-card p {
    color: #5b6478;
    font-size: .88rem;
    line-height: 1.65;
    margin: 0;
}

.tech-chip {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: .76rem;
    font-weight: 600;
    color: #334155;
}

.stack-card {
    background: #fff;
    border: 1px solid #e8ecf3;
    border-radius: 16px;
    padding: 8px 22px;
    box-shadow: var(--shadow-sm);
}

.stack-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 0;
    border-bottom: 1px solid #f0f2f7;
}

.stack-row:last-child {
    border-bottom: 0;
}

.stack-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: #f4f6fb;
    color: #4f46e5;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.stack-row strong {
    display: block;
    font-size: .87rem;
    color: var(--ink);
}

.stack-row small {
    display: block;
    color: var(--muted);
    font-size: .75rem;
}

.stack-status {
    margin-left: auto;
    font-size: .68rem;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 999px;
    background: #e7f8f0;
    color: #047857;
    white-space: nowrap;
}

.stack-status.neutral {
    background: #f1f5f9;
    color: #64748b;
}

.cta-panel {
    background: linear-gradient(135deg, #4f46e5, #4338ca);
    color: #fff;
    border-radius: 20px;
    padding: 38px 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
    box-shadow: 0 24px 60px -34px rgba(67, 56, 202, .9);
}

.cta-panel h2 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -.02em;
    margin-bottom: 6px;
}

.cta-panel p {
    color: rgba(255, 255, 255, .78);
    font-size: .9rem;
    max-width: 44rem;
}

.cta-panel code {
    background: rgba(255, 255, 255, .14);
    color: #e0e7ff;
}

.cta-panel-dark {
    background: var(--ink);
}

.error-page {
    padding: 80px 20px;
    text-align: center;
    max-width: 620px;
    margin: 0 auto;
}

.error-code {
    font-size: clamp(4rem, 12vw, 6rem);
    font-weight: 800;
    letter-spacing: -.05em;
    line-height: 1;
    color: #e0e5ef;
    display: block;
    margin-bottom: 10px;
}

.error-page h1 {
    font-size: 1.7rem;
    font-weight: 700;
    letter-spacing: -.03em;
    color: var(--ink);
}

.error-page p {
    color: var(--muted);
    margin-bottom: 22px;
    line-height: 1.7;
}

/* --------------------------------------------------------------------------
   Hosted capture form
   -------------------------------------------------------------------------- */

.form-body {
    min-height: 100vh;
    padding: 38px 16px 26px;
    background:
        radial-gradient(900px 460px at 15% 0%, #eef0ff, transparent 65%),
        radial-gradient(700px 420px at 100% 12%, #e6fbf8, transparent 62%),
        #f7f8fc;
}

.form-shell {
    max-width: 660px;
    margin: 0 auto;
}

.form-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--ink);
    text-decoration: none;
    font-weight: 700;
    margin-bottom: 20px;
}

.form-brand:hover {
    color: var(--ink);
}

.form-card {
    background: #fff;
    border: 1px solid #e7ebf3;
    border-radius: 22px;
    padding: 34px;
    box-shadow: 0 28px 70px -38px rgba(15, 23, 42, .45);
}

.form-card-head {
    margin-bottom: 22px;
}

.form-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--brand);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    margin-bottom: 9px;
}

.form-card-head h1 {
    font-size: 1.55rem;
    font-weight: 700;
    letter-spacing: -.025em;
    color: var(--ink);
    margin: 0 0 7px;
}

.form-card-head p {
    color: var(--muted);
    font-size: .9rem;
    line-height: 1.65;
    margin: 0;
}

.form-card .form-control,
.form-card .form-select {
    padding: .68rem .85rem;
    font-size: .92rem;
    border-radius: 10px;
}

.form-card .form-label {
    font-size: .815rem;
    font-weight: 600;
    color: #2c3852;
    margin-bottom: 5px;
}

.form-fieldset {
    border: 0;
    padding: 0;
    margin: 0;
    min-width: 0;
}

.form-fieldset legend {
    float: none;
    width: auto;
    font-size: .815rem;
    font-weight: 600;
    color: #2c3852;
    margin-bottom: 6px;
}

.form-card .form-check {
    margin-bottom: 4px;
}

.form-card .form-check-label {
    font-size: .88rem;
    color: #3d4a63;
}

.form-submit {
    margin-top: 22px;
}

.form-consent {
    font-size: .73rem;
    color: #8993a6;
    text-align: center;
    margin: 12px 0 0;
    line-height: 1.6;
}

.hp-field {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.form-alert {
    margin-bottom: 16px;
    border-radius: 12px;
    font-size: .85rem;
    border: 0;
    padding: 12px 14px;
}

.form-foot {
    text-align: center;
    color: #8a94a8;
    font-size: .75rem;
    margin-top: 18px;
}

.form-foot a {
    color: #6d788f;
    text-decoration: none;
}

.form-foot a:hover {
    color: var(--brand);
}

.thanks-wrap {
    text-align: center;
    padding: 16px 0 6px;
}

.thanks-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #e7f8f0;
    color: #047857;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.7rem;
    margin-bottom: 16px;
}

.thanks-wrap h1 {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -.03em;
    color: var(--ink);
    margin-bottom: 8px;
}

.thanks-copy {
    color: var(--muted);
    font-size: .92rem;
    line-height: 1.7;
    max-width: 420px;
    margin: 0 auto 22px;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 1199.98px) {
    .page-head {
        align-items: flex-start;
    }
}

@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform .2s ease;
        width: 270px;
    }

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

    .sidebar-backdrop {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(11, 18, 32, .5);
        z-index: 1040;
    }

    .sidebar-open .sidebar-backdrop {
        display: block;
    }

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

    .topbar {
        padding: 11px 16px;
    }

    .app-content {
        padding: 18px 16px 36px;
    }

    .auth-shell {
        grid-template-columns: 1fr;
    }

    .auth-aside {
        display: none;
    }

    .auth-main {
        min-height: 100vh;
        padding: 26px 16px;
    }

    .panel {
        padding: 18px;
    }

    .panel-flush {
        padding: 0;
    }

    .panel-head-pad {
        padding: 18px 18px 0;
    }

    .panel-foot {
        padding: 12px 18px 16px;
    }

    .hero {
        padding: 48px 0 40px;
    }

    .section {
        padding: 46px 0;
    }

    .cta-panel {
        padding: 28px;
    }

    .form-card {
        padding: 24px 20px;
        border-radius: 18px;
    }
}

@media (max-width: 575.98px) {
    .page-title {
        font-size: 1.25rem;
    }

    .stat-value {
        font-size: 1.6rem;
    }

    .chart {
        height: 160px;
    }

    .chart-label {
        font-size: .55rem;
    }

    .breakdown-label {
        flex-basis: 64px;
    }

    .hero-visual {
        padding: 0 0 30px;
    }

    .form-body {
        padding-top: 22px;
    }

    .form-card {
        padding: 22px 18px;
    }

    .form-card-head h1 {
        font-size: 1.35rem;
    }

    .cta-panel {
        padding: 24px;
    }

    .cta-panel h2 {
        font-size: 1.3rem;
    }
}

/* Respect reduced motion */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
    }
}

/* --------------------------------------------------------------------------
   Exhibition capture
   -------------------------------------------------------------------------- */

[hidden] {
    display: none !important;
}

.capture-type {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.capture-type input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.capture-type label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 16px 18px;
    cursor: pointer;
    background: #fff;
    transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}

.capture-type label strong {
    font-size: .95rem;
    color: var(--ink);
}

.capture-type label small {
    color: var(--muted);
    font-size: .76rem;
}

.capture-type input:checked + label {
    border-color: var(--brand);
    background: var(--brand-soft);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, .08);
}

.capture-type input:focus-visible + label {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}

.capture-type-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: #f4f6fb;
    color: var(--brand);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
}

.capture-type input:checked + label .capture-type-icon {
    background: #fff;
}

.staff-strip {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #f8faff;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 12px 14px;
}

.staff-strip strong {
    display: block;
    font-size: .9rem;
}

.staff-strip small {
    color: var(--muted);
    font-size: .76rem;
}

.whatsapp-note {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 12px;
    padding: 13px 14px;
}

.whatsapp-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #dcfce7;
    color: #15803d;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex: 0 0 auto;
}

.whatsapp-note strong {
    display: block;
    font-size: .85rem;
    color: #14532d;
}

.whatsapp-note p {
    margin: 2px 0;
    font-size: .82rem;
    color: #166534;
}

.whatsapp-note small {
    color: #4d7c5e;
    font-size: .72rem;
}

/* Analytics */

.chart-dense {
    gap: 3px;
}

.chart-dense .chart-bar {
    max-width: 18px;
    border-radius: 4px 4px 2px 2px;
}

.chart-dense .chart-label {
    font-size: .52rem;
}

.chart-short {
    height: 120px;
}

.breakdown-label {
    flex-basis: 96px;
}

.analytics-bar-cell {
    min-width: 130px;
}

@media (max-width: 575.98px) {
    .capture-type {
        grid-template-columns: 1fr;
    }

    .whatsapp-note {
        flex-direction: column;
    }
}
