/*
Purpose: Theme (light)
Description: Centralized color tokens, layout, sidebar, forms, onboarding, and UI tweaks.
*/

/* =====================================================================
   0) Root / Variables — single source of truth for colors & sizes
   ===================================================================== */
:root {
    /* ===== Brand Palette ===== */
    --color-primary: #005;
    /* main brand blue */
    --color-primary-hover: #559;
    /* hover for primary elements */
    --color-accent: #44a;
    /* secondary accent */

    /* ===== Base Surfaces ===== */
    --color-bg: #eef;
    /* page bg (light blue) */
    --color-bg-gradient: #dde;
    /* top gradient tint */
    --color-bg-header: #fec;
    /* module header bg (light orange) */
    --color-bg-selector: #eef;
    /* structure selector bg */
    --color-card-bg: #fff;
    /* cards, panels */

    /* Sidebar/Main tokens (used later) */
    --sidebar-bg: #fff;
    --sidebar-fg: #005;
    --content-bg: #eef;

    /* ===== Text ===== */
    --color-text-dark: #005;
    /* primary text */
    --color-text-muted: #88b;
    /* generic muted */
    --color-text-light: #f90;
    /* subtle labels, helper lines */
    --color-disabled: #88b;
    /* disabled nav item */

    /* ===== Status & Badges ===== */
    --ok: #0b4;
    --warn: #f90;
    --danger: #f22;
    --color-status: #045;
    /* pill text */
    --color-status-bg: #eef;
    /* pill bg */
    --badge-bg: #def;
    /* generic pill bg */

    /* Billing status chips */
    --paid: #064;
    --paid-bg: #eff;
    --pending: #a31;
    --pending-bg: #fed;
    --late: #922;
    --late-bg: #fee;

    /* ===== Borders / Shadows / Radius ===== */
    --color-border: #cce;
    --shadow-default: 0 10px 24px rgba(33, 35, 38, .08);
    --radius: 10px;

    /* ===== Onboarding accents ===== */
    --brand-deep: #005;
    --accent-1: #227;
    --accent-2: #404;

    /* ===== Login / Cards generic ===== */
    --bg: #fff;
    --card: #fff;
    --ink: #225;
    --shadow: 0 8px 30px rgba(0, 0, 0, .08);

    /* ===== Typography ===== */
    --font-family-base: "Jost", sans-serif;
    --font-family-heading: "Jost", sans-serif;
    --font-size-base: 14px;
    --font-size-heading: 30px;

    /* ===== UI Tweaks ===== */
    --pill-bg: #f4f6f8;
    --repeat-border: #e7eaee;

    --badge-included-bg: #eef7ee;
    --badge-included-fg: #1f6b2a;

    --badge-warning-bg: #fff4e5;
    --badge-warning-fg: #8a4b00;

    --pending-card-border: #ffe4c2;
    --pending-card-bg: #fffaf3;

    --pulse-color: rgba(255, 100, 0, .6);
    /* animation glow */

    /* Firefox scrollbar */
    scrollbar-width: thin;
    scrollbar-color: var(--color-border) var(--color-card-bg);
}

/* =====================================================================
   1) Reset & Base
   ===================================================================== */
* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    height: 100%;
    width: 100%;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font: inherit;
    cursor: pointer;
}

body {
    font-family: var(--font-family-base);
    font-size: var(--font-size-base);
    color: var(--color-text-dark);
    background: linear-gradient(180deg, var(--color-bg-gradient), var(--color-bg) 160px);
}

/* Keep vertical scroll ownership stable */
/* Removed scrollbar-gutter to prevent right margin */

/* Unified thin, light scrollbars (WebKit/Blink) */
html::-webkit-scrollbar,
body::-webkit-scrollbar,
.sidebar::-webkit-scrollbar,
.nav::-webkit-scrollbar,
.content::-webkit-scrollbar,
.page::-webkit-scrollbar {
    width: 6px;
    /* vertical */
    height: 6px;
    /* horizontal */
}

html::-webkit-scrollbar-track,
body::-webkit-scrollbar-track,
.sidebar::-webkit-scrollbar-track,
.nav::-webkit-scrollbar-track,
.content::-webkit-scrollbar-track,
.page::-webkit-scrollbar-track {
    background: var(--color-card-bg);
    border-radius: 8px;
}

html::-webkit-scrollbar-thumb,
body::-webkit-scrollbar-thumb,
.sidebar::-webkit-scrollbar-thumb,
.nav::-webkit-scrollbar-thumb,
.content::-webkit-scrollbar-thumb,
.page::-webkit-scrollbar-thumb {
    background-color: var(--color-border);
    border-radius: 8px;
    border: 2px solid var(--color-card-bg);
    /* inset look */
    background-clip: content-box;
}

html::-webkit-scrollbar-thumb:hover,
body::-webkit-scrollbar-thumb:hover,
.sidebar::-webkit-scrollbar-thumb:hover,
.nav::-webkit-scrollbar-thumb:hover,
.content::-webkit-scrollbar-thumb:hover,
.page::-webkit-scrollbar-thumb:hover {
    background-color: var(--color-text-muted);
}

html::-webkit-scrollbar-thumb:active,
body::-webkit-scrollbar-thumb:active,
.sidebar::-webkit-scrollbar-thumb:active,
.nav::-webkit-scrollbar-thumb:active,
.content::-webkit-scrollbar-thumb:active,
.page::-webkit-scrollbar-thumb:active {
    background-color: var(--color-primary-hover);
}

/* =====================================================================
   2) Login Page
   ===================================================================== */
.center {
    min-height: 100%;
    display: grid;
    place-items: start center;
    padding: 48px 24px;
}

.login-container {
    background: var(--color-card-bg);
    padding: 40px;
    border-radius: 12px;
    box-shadow: var(--shadow-default);
    width: 350px;
    text-align: center;
    margin: auto;
}

.login-container.wide {
    width: 880px;
    text-align: left;
}

.login-container img {
    max-width: 260px;
    height: auto;
    display: block;
    margin: 0 auto 12px;
}

.login-container h2 {
    margin-bottom: 20px;
    font-family: var(--font-family-heading);
    font-size: var(--font-size-heading);
    color: var(--color-text-dark);
}


.login-container input,
.login-container select,
.login-container textarea,
.vscomp-toggle-button {
    width: 100% !important;
    min-width: 250px;
    padding: 12px !important;
    margin: 0 0 6px 0;
    border-radius: 8px;
    border: 1px solid var(--color-border);
    color: var(--color-text-dark) !important;
    font-size: var(--font-size-base);
    font-family: var(--font-family-base);
    background: var(--color-card-bg);
}

.field input {
     width: 80% !important;
     min-width: 250px;
     padding: 12px !important;
     margin: 0 0 6px 0;
     border-radius: 8px;
     border: 1px solid var(--color-border);
     color: var(--color-text-dark) !important;
     font-size: var(--font-size-base);
     font-family: var(--font-family-base);
     background: var(--color-card-bg);
 }

/*
.login-container button {
    width: 100%;
    padding: 12px;
    margin-top: 12px;
    background: var(--color-text-dark);
    color: var(--color-card-bg);
    border: none;
    border-radius: 8px;
    font-size: var(--font-size-base);
    font-family: var(--font-family-heading);
    transition: .3s;
}
*/

.login-container button:hover {
    background: var(--color-primary-hover);
}

.login-container .links {
    margin-top: 15px;
    font-size: 13px;
}

.login-container .links a {
    color: var(--color-accent);
}

.login-container .form-muted,
.login-container .form-help {
    color: var(--color-text-light);
    font-size: 12px;
}

.login-container .form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 12px;
}

.login-container .field {
    margin: 8px 0;
}

.login-container .field label {
    display: block;
    font-size: 10px;
    font-weight: 400;
    margin-bottom: 2px;
}

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

.login-container .form-grid.three {
    grid-template-columns: 1fr 1fr 1fr;
}

.login-container .form-grid .span-2 {
    grid-column: span 2;
}

@media (max-width: 900px) {
    .login-container.wide {
        width: 96vw;
    }

    .login-container .form-grid,
    .login-container .form-grid.three {
        grid-template-columns: 1fr;
    }

    .login-container .form-grid .span-2 {
        grid-column: auto;
    }
}

.login-container .pwd-meter {
    height: 6px;
    border-radius: 4px;
    background: var(--badge-bg);
    overflow: hidden;
    margin-top: 6px;
}

.login-container .pwd-bar {
    height: 100%;
    width: 0;
    background: var(--color-primary);
    transition: width .2s ease;
}

/* =====================================================================
   3) App Layout & Sidebar
   ===================================================================== */

/* Sidebar + main scrollers: vertical only */
.sidebar,
.nav,
.content,
.page {
    overflow-x: hidden;
}

.app {
    display: flex;
    min-width: 0;
    min-height: 100vh;
    width: 100%;
    margin: 0;
    padding: 0;
}

/* Main content area */
.content {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 100vh;
    background: var(--content-bg);
    display: grid;
    grid-template-rows: auto 1fr;
    margin: 0;
    padding: 0;
}

.page {
    padding: 20px;
    min-height: 100%;
    margin: 0;
}

/* Hamburger (single source) */
.menu-toggle {
    background: transparent;
    border: none;
    font-size: 22px;
    color: var(--color-primary);
    position: absolute;
    top: 18px;
    right: 18px;
    z-index: 1100;
}

/* Sidebar base */
.sidebar {
    display: flex;
    flex-direction: column;
    background: var(--sidebar-bg);
    color: var(--sidebar-fg);
    border-right: 1px solid var(--color-border);
    padding: 12px 10px;
    margin: 0;
    backface-visibility: hidden;
    contain: paint;
}

/* Sidebar nav: ensure only vertical scroll appears */
.nav {
    margin-top: 18px;
    display: grid;
    gap: 6px;
    flex: 1 1 auto;
    min-height: 0;
    /* allow it to shrink inside sticky container */
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

/* Removed fade effect at the bottom of the nav list */

/* Desktop: sticky */
@media (min-width: 1025px) {
    .sidebar {
        flex: 0 0 260px;
        position: sticky;
        top: 0;
        width: 260px;
        height: 100vh;
        /* fill viewport */
        min-height: 100vh;
        overflow: auto;
        /* sidebar scrolls its own content */
    }

    .menu-toggle {
        display: none !important;
    }
}

/* Mobile/Tablet: off-canvas */
@media (max-width: 1024px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 260px;
        height: 100vh;
        transform: translateX(-100%);
        transition: transform .25s ease-in-out;
        z-index: 1000;
        box-shadow: none;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: 0 0 0 9999px rgba(0, 0, 0, .3);
    }

    .sidebar .brand-title,
    .sidebar .link-text {
        display: none;
    }

    .sidebar.open .brand-title,
    .sidebar.open .link-text {
        display: inline !important;
    }
}

/* Structure Selector */
#structure_id {
    width: 100%;
    margin-top: 6px;
    padding: 6px 10px;
    border-radius: 8px;
    font-family: var(--font-family-base);
    color: var(--color-primary);
    border: 1px solid var(--color-border);
    background: var(--color-bg-selector);
    flex: 0 0 auto;
}

/* Branding row */
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 10px;
    flex: 0 0 auto;
}

/* Nav links */
.nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 2px 12px;
    border-radius: 10px;
    color: var(--sidebar-fg);
}

.nav a[aria-current="page"],
.nav a:hover {
    background: rgba(0, 0, 255, .05);
}

.nav a.disabled {
    pointer-events: none;
    color: var(--color-disabled);
    opacity: .6;
    cursor: not-allowed;
    position: relative;
}

.nav a.disabled::after {
    content: "Coming soon";
    position: absolute;
    top: 50%;
    left: 100%;
    transform: translateY(-50%);
    background: var(--color-disabled);
    color: var(--color-card-bg);
    font-size: 11px;
    padding: 4px 6px;
    border-radius: 4px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease-in-out;
    margin-left: 8px;
    z-index: 10;
}

.nav a.disabled:hover::after {
    opacity: 1;
}

.nav hr {
    opacity: 0;
}

/* =====================================================================
   3B) App Page Forms & Fields (scoped to .page)
   ===================================================================== */
.page .form-wrap {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 16px;
    align-items: start;
}

@media (max-width:1100px) {
    .page .form-wrap {
        grid-template-columns: 1fr;
    }
}

.page .form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 16px;
}

.page .form-grid.three {
    grid-template-columns: 1fr 1fr 1fr;
}

.page .form-grid .span-2 {
    grid-column: span 2;
}

@media (max-width:900px) {

    .page .form-grid,
    .page .form-grid.three {
        grid-template-columns: 1fr;
    }

    .page .form-grid .span-2 {
        grid-column: auto;
    }
}

/* Field base */
.page .field {
    margin: 8px 0;
}

.page .field label {
    display: block;
    margin-bottom: 4px;
    font-size: 12px;
    font-weight: 500;
    color: var(--color-text-dark);
}

.page select,
.page textarea,
.page input[type="text"],
.page input[type="email"],
.page input[type="password"],
.page input[type="date"],
.page input[type="tel"],
.page input[type="number"],
.page input[type="file"] {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--color-border);
    color: var(--color-text-dark);
    background: var(--color-card-bg);
    font-size: var(--font-size-base);
    font-family: var(--font-family-base);
}

/* Primary button */
.vt-btn, .btn.primary {
    background: linear-gradient(135deg, var(--accent-1), var(--accent-2)) !important;
    color: #fff;
    border: 0;
}

.vt-btn, .btn.primary:hover {
    filter: brightness(1.03);
}

/* =====================================================================
   4) Greeting / Titles
   ===================================================================== */
.greeting {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 8px 0 18px;
}

.greeting h1 {
    margin: 0;
    font-family: var(--font-family-heading);
    font-size: var(--font-size-heading);
}

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

.greeting .page-message {
    font-size: var(--font-size-base);
    color: var(--color-text-light);
    line-height: 1.35;
}

.greeting .page-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* =====================================================================
   5) Cards / KPIs / Status
   ===================================================================== */
.d-card-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 14px;
    align-items: stretch;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    /* 4 equal columns */
    gap: 14px;
    align-items: stretch;
}

/* First two items: big cards on top (2fr each in practice) */
@media (min-width: 768px) {
    .card-grid> :nth-child(1),
    .card-grid> :nth-child(2) {
        grid-column: span 2;
    }
}

.card {
    background: var(--color-card-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 14px;
    box-shadow: var(--shadow-default);
}

.kpi-label {
    color: var(--color-text-light);
    font-size: 12px;
    letter-spacing: .2px;
}

.kpi-value {
    font-weight: 600;
    margin-top: 6px;
    font-size: 18px;
}

.kpi-detail {
    font-weight: 400;
    margin-top: 6px;
    font-size: 12px;
}

.status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-right: 10px;
    color: var(--color-status);
    background: var(--color-status-bg);
    border: 1px solid var(--color-status);
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 12px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--ok);
    display: inline-block;
}

/* Progress bars */
.progress {
    position: relative;
    height: 8px;
    background: var(--color-bg);
    border-radius: 999px;
    overflow: hidden;
    margin-top: 8px;
}

.progress>span {
    position: absolute;
    height: 100%;
    left: 0;
    top: 0;
    background: linear-gradient(90deg, var(--color-bg), var(--color-primary));
}

/* Two-column / Stack / Modules */
.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 16px;
}

.stack {
    display: grid;
    gap: 16px;
}

.module {
    background: var(--color-card-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-default);
}

.module h3 {
    margin: 0;
    padding: 14px 16px;
    background: var(--color-bg-header);
    border-top-left-radius: var(--radius);
    border-top-right-radius: var(--radius);
    border-bottom: 1px solid var(--color-border);
    font-size: 14px;
    letter-spacing: .2px;
    font-family: var(--font-family-heading);
}

.module .body {
    padding: 14px 16px;
}

/* Address helpers */
.address-main {
    font-weight: 600;
}

.address-sub {
    color: var(--color-text-light);
    font-size: 13px;
}

/* =====================================================================
   6) Tables
   ===================================================================== */
table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    text-align: left;
    padding: 10px 8px;
}

thead th {
    font-size: 12px;
    color: var(--color-primary);
    border-bottom: 1px solid var(--color-border);
}

tbody tr {
    border-bottom: 1px solid var(--color-border);
}

tbody tr:hover {
    background: var(--color-bg);
}

/* =====================================================================
   7) Buttons
   ===================================================================== */
.vt-btn, .btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid var(--color-border);
    background: var(--color-bg-header);
    box-shadow: var(--shadow-default);
}

/* =====================================================================
   8) Billing
   ===================================================================== */
.billing-title {
    margin: 0 0 8px;
    font-family: var(--font-family-heading);
}

.module--company {
    margin-bottom: 12px;
}

.module--company .body p {
    margin: 0 0 6px;
}

.module--company .body table {
    margin-top: 8px;
}

.billing-card .body {
    display: grid;
    gap: 8px;
}

.billing-card .topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.billing-card .amount {
    font-size: 1.25rem;
    font-weight: 600;
}

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: .8rem;
    background: var(--badge-bg);
}

.badge.paid {
    background: var(--paid-bg);
    color: var(--paid);
}

.badge.pending {
    background: var(--pending-bg);
    color: var(--pending);
}

.badge.late {
    background: var(--late-bg);
    color: var(--late);
}

.progressbar {
    height: 8px;
    background: var(--color-bg);
    border-radius: 6px;
    overflow: hidden;
}

.progressbar>span {
    display: block;
    height: 100%;
    background: var(--color-text-dark);
    width: 0%;
}

.billing-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 2px;
}

/* =====================================================================
   9) Upload cards (users_edit.php)
   ===================================================================== */
.upload-card {
    background: #fff;
    border: 1px solid #eee;
    padding: 10px;
    border-radius: 6px;
    box-shadow: none;
}

.upload-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    margin-top: 10px;
}

.upload-card img {
    display: block;
    max-width: 100%;
    height: 140px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #f0f0f0;
}

.upload-card .upload-actions {
    margin-top: 8px;
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
}

.upload-card .btn {
    padding: 6px 10px;
    font-size: .95rem;
    border-radius: 8px;
    display: inline-block;
}

.upload-card .btn--danger {
    margin-top: 0;
    background: transparent;
    border: 1px solid #f2a0a0;
    color: #a33;
    padding: 6px 10px;
    border-radius: 8px;
    cursor: pointer;
}

.upload-card .btn--danger:hover {
    background: #fff1f1;
}

/* =====================================================================
   10) Chat button
   ===================================================================== */
.chat {
    position: fixed;
    right: 18px;
    bottom: 18px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 0;
    background: linear-gradient(135deg, var(--color-text-dark), var(--color-accent));
    color: var(--color-card-bg);
    box-shadow: var(--shadow-default);
}

.chat:after {
    content: "?";
    font-weight: 800;
    font-size: 20px;
}

/* =====================================================================
   11) Onboarding (index.php)
   ===================================================================== */
.page.onboard {
    background: transparent !important;
}

.page.onboard .greeting {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0 0 10px;
}

/*
.page.onboard .greeting h1 {
    font-size: 36px;
    margin: 0;
    letter-spacing: .2px;
    color: var(--brand-deep);
}
*/

.page.onboard .intro {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    align-items: center;
    margin: 0 0 18px;
}

@media (min-width: 1000px) {
    .page.onboard .intro {
        grid-template-columns: 1.2fr .8fr;
    }
}

.page.onboard .admin-msg {
    line-height: 1.6;
    color: var(--color-primary);
}

.page.onboard .intro-art {
    border-radius: 16px;
    background-image: var(--intro-img);
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    min-height: clamp(180px, 24vw, 420px);
    box-shadow: none;
}

.page.onboard .intro-art {
    --intro-img: url('../assets/images/valeriafeliciano.png');
}

.page.onboard .wrapper {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
}

@media (min-width: 900px) {
    .page.onboard .wrapper {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1200px) {
    .page.onboard .wrapper {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1400px) {
    .page.onboard .wrapper {
        grid-template-columns: repeat(5, 1fr);
    }
}

.page.onboard .vcard {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 20px;
    border-radius: 18px;
    color: #fff;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow);
    transform: translateY(0);
    transition: transform .18s ease, box-shadow .18s ease, opacity .2s ease;
}

.page.onboard .vcard .icon {
    font-size: 28px;
    line-height: 1;
    color: #fff;
}

.page.onboard .vcard h3 {
    margin: 0;
    font-size: 18px;
}

.page.onboard .vcard p {
    margin: 0;
    opacity: .95;
}

.page.onboard .vcard .chev {
    position: absolute;
    right: 16px;
    bottom: 16px;
    font-size: 18px;
    opacity: .95;
    color: #fff;
}

.page.onboard .vcard:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 36px rgba(0, 0, 0, .12);
}

.page.onboard .gblue {
    background: linear-gradient(135deg, var(--brand-deep), var(--accent-1) 40%, var(--accent-2));
}

.page.onboard .gorange {
    background: linear-gradient(135deg, #ff9900, #ffb84d);
    border: 2px dashed #ffffff;
    color: #fff;
}

/* Legacy white help card */
.page.onboard .help-card {
    background: #fff;
    color: var(--ink);
    box-shadow: var(--shadow);
    border-radius: 18px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    text-decoration: none;
}

.page.onboard .help-card h4 {
    margin: 0 0 8px;
    font-size: 18px;
    color: var(--brand-deep);
}

.page.onboard .help-card a {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--ink);
    padding: 10px 12px;
    border-radius: 12px;
    background: #f8f9ff;
    transition: background .15s ease;
}

.page.onboard .help-card a:hover {
    background: #eef1ff;
}

/* Reveal animation */
.page.onboard .reveal {
    opacity: 0;
    transform: translateY(8px);
    animation: reveal .5s .05s forwards;
}

.page.onboard .reveal.d2 {
    animation-delay: .12s;
}

.page.onboard .reveal.d3 {
    animation-delay: .18s;
}

.page.onboard .reveal.d4 {
    animation-delay: .24s;
}

@keyframes reveal {
    to {
        opacity: 1;
        transform: none;
    }
}

.sticky-cta {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--brand-deep), var(--accent-1) 40%, var(--accent-2));
    padding: 12px 16px;
    display: none;
    z-index: 999;
    box-shadow: 0 -6px 20px rgba(0, 0, 0, .15);
}

.sticky-cta .btn {
    width: 100%;
    display: inline-block;
    text-align: center;
    text-decoration: none;
    background: #fff;
    color: var(--brand-deep);
    font-weight: 700;
    padding: 12px 16px;
    border-radius: 12px;
}

@media (max-width:560px) {
    .sticky-cta {
        display: block;
    }

    .footer-spacer {
        height: 64px;
    }
}

/* =====================================================================
   12) UI Tweaks
   ===================================================================== */
label.checkline {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
}

label.checkline .pull-right {
    margin-left: auto;
}

label.checkline.inactive {
    opacity: .45;
    filter: grayscale(1);
}

label.checkline.inactive .pull-right {
    text-decoration: line-through;
    opacity: .75;
}

.pill {
    background: var(--pill-bg);
    border-radius: 16px;
    padding: 4px 10px;
    display: inline-block;
}

.muted {
    opacity: .7;
}

.repeatable .repeat-row {
    border: 1px dashed var(--repeat-border);
    padding: 8px;
    border-radius: 8px;
    margin-bottom: 8px;
}

.field .inline {
    display: flex;
    align-items: center;
    gap: 10px;
}

.badge-included {
    font-size: 12px;
    background: var(--badge-included-bg);
    color: var(--badge-included-fg);
    padding: 3px 8px;
    border-radius: 10px;
    margin-left: 8px;
}

.badge-warning {
    font-size: 12px;
    background: var(--badge-warning-bg);
    color: var(--badge-warning-fg);
    padding: 3px 8px;
    border-radius: 10px;
    margin-left: 8px;
}

.pending-card {
    border: 1px solid var(--pending-card-border);
    background: var(--pending-card-bg);
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 12px;
}

.pending-card h4 {
    margin: 0 0 6px;
    font-size: 1rem;
}

/* Pulse animations */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 var(--pulse-color);
    }

    70% {
        box-shadow: 0 0 0 12px rgba(255, 100, 0, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(255, 100, 0, 0);
    }
}

.pulse,
.pulse-disabled {
    animation: pulse 1.2s ease-in-out infinite;
}

/* helper */
.vcard.pulse {
    animation-duration: 1.4s;
}

/* Make reveal + pulse coexist */
.page.onboard .reveal.pulse {
    animation: reveal .5s .05s forwards, pulse 1.2s ease-in-out infinite;
}

.page.onboard .reveal.d2.pulse {
    animation: reveal .5s .12s forwards, pulse 1.2s ease-in-out infinite;
}

.page.onboard .reveal.d3.pulse {
    animation: reveal .5s .18s forwards, pulse 1.2s ease-in-out infinite;
}

.page.onboard .reveal.d4.pulse {
    animation: reveal .5s .24s forwards, pulse 1.2s ease-in-out infinite;
}

/* Respect user preference */
@media (prefers-reduced-motion: reduce) {

    .pulse,
    .vcard.pulse,
    .pulse-disabled,
    .page.onboard .reveal.pulse,
    .page.onboard .reveal.d2.pulse,
    .page.onboard .reveal.d3.pulse,
    .page.onboard .reveal.d4.pulse {
        animation: none !important;
    }
}

/* =====================================================================
   13) Responsive Layout helpers
   ===================================================================== */
@media (max-width:1100px) {
    .two-col {
        grid-template-columns: 1fr;
    }

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

    .card-grid>.card-grid:first-child,
    .card-grid .card--primary {
        grid-column: 1 / -1;
    }
}

@media (max-width:700px) {

    html,
    body {
        overflow-x: hidden;
        min-height: 100%;
    }

    .app,
    .content,
    .page,
    .two-col,
    .stack,
    .card-grid,
    .module,
    .nav,
    .brand {
        min-width: 0;
    }

    .content {
        margin: 0 !important;
        transform: none !important;
    }

    a,
    .address-sub,
    .module .body {
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    img,
    video {
        max-width: 100%;
        height: auto;
    }

    /* Tables: allow own horizontal scroll on small screens */
    .module .body,
    .module .body table {
        display: block;
    }

    .module .body table {
        width: 100%;
        overflow-x: auto;
    }

    .module .body thead,
    .module .body tbody,
    .module .body tr {
        display: table;
        width: 100%;
        table-layout: fixed;
    }

    /* Tooltip off on mobile */
    .nav a.disabled::after {
        display: none !important;
    }
}

/* Optional safety so long text/admin HTML can't force overflow */
.page.onboard .admin-msg,
.page.onboard .intro,
.page.onboard .wrapper {
    overflow-wrap: anywhere;
    word-break: break-word;
}