:root {
    --dm-primary: #4f46e5;
    --dm-primary-dark: #4338ca;
    --dm-bg: #f5f6fa;
    --dm-sidebar: #1e1b4b;
    --dm-sidebar-muted: #a5b4fc;
    --dm-radius: 12px;
    --dm-shadow: 0 1px 3px rgba(16, 24, 40, .06), 0 1px 2px rgba(16, 24, 40, .04);
    --dm-shadow-md: 0 4px 16px rgba(16, 24, 40, .08);
}

html { font-size: 15px; }
body {
    background: var(--dm-bg);
    color: #1f2937;
    font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    min-height: 100vh;
}

/* Brand accents */
.btn-primary { --bs-btn-bg: var(--dm-primary); --bs-btn-border-color: var(--dm-primary); --bs-btn-hover-bg: var(--dm-primary-dark); --bs-btn-hover-border-color: var(--dm-primary-dark); }
.btn-outline-primary { --bs-btn-color: var(--dm-primary); --bs-btn-border-color: var(--dm-primary); --bs-btn-hover-bg: var(--dm-primary); --bs-btn-hover-border-color: var(--dm-primary); }
.text-primary { color: var(--dm-primary) !important; }
a { color: var(--dm-primary); }
.card { border-radius: var(--dm-radius); box-shadow: var(--dm-shadow); }
.card .card { box-shadow: none; }
.shadow-sm { box-shadow: var(--dm-shadow) !important; }
.btn { border-radius: 9px; font-weight: 500; }
.form-control, .form-select { border-radius: 9px; }
.badge { font-weight: 500; }

/* ===== App shell with sidebar ===== */
.app-shell { display: flex; min-height: 100vh; }

.app-sidebar {
    width: 250px;
    background: var(--dm-sidebar);
    color: #e0e7ff;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}
.app-sidebar .brand {
    font-weight: 700;
    font-size: 1.15rem;
    color: #fff;
    padding: 1.1rem 1.25rem;
    letter-spacing: .2px;
    border-bottom: 1px solid rgba(255,255,255,.08);
}
.app-sidebar .brand .dot { color: #818cf8; }
.app-sidebar .nav-section { padding: 1rem 1.25rem .35rem; font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: var(--dm-sidebar-muted); opacity: .8; }
.app-sidebar .nav-link {
    color: #c7d2fe;
    padding: .55rem 1.25rem;
    display: flex;
    align-items: center;
    gap: .7rem;
    font-size: .92rem;
    border-left: 3px solid transparent;
}
.app-sidebar .nav-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.app-sidebar .nav-link.active { background: rgba(129,140,248,.16); color: #fff; border-left-color: #818cf8; }
.app-sidebar .nav-link i { width: 1.1rem; text-align: center; opacity: .9; }

.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.app-topbar {
    background: #fff;
    border-bottom: 1px solid #eaecf0;
    padding: .6rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky; top: 0; z-index: 20;
}
.app-content { padding: 1.5rem; flex: 1; }
.app-content > h1:first-child, .app-content .page-title { font-weight: 650; }

/* Standard page header (see PageHeaderTagHelper) — one spacing rule everywhere */
.page-header { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.page-header h1 { font-weight: 650; }
.page-header-titles { min-width: 0; }
.page-header-actions { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }

/* Toolbar/filter forms — replaces ad-hoc inline max-width styles for uniform widths */
.toolbar-form { margin-bottom: 1.25rem; }
.filter-control { max-width: 360px; }
.filter-control-sm { max-width: 260px; }

.avatar {
    width: 34px; height: 34px; border-radius: 50%;
    background: var(--dm-primary); color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 600; font-size: .85rem;
}

/* Tables */
.table > thead { --bs-table-bg: #fafafe; }
.table thead th { font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: #667085; font-weight: 600; }

/* Auth / centered pages */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 2rem 1rem;
    background: linear-gradient(135deg, #eef2ff 0%, #f5f6fa 60%); }
.auth-brand { font-weight: 700; color: var(--dm-primary); font-size: 1.4rem; }

/* Mobile sidebar */
@media (max-width: 991.98px) {
    .app-sidebar { position: fixed; left: -260px; z-index: 1050; transition: left .2s ease; box-shadow: var(--dm-shadow-md); }
    .app-sidebar.open { left: 0; }
    .sidebar-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 1040; }
}
.btn:focus, .form-control:focus, .form-select:focus, .form-check-input:focus {
    box-shadow: 0 0 0 .2rem rgba(79,70,229,.2);
    border-color: var(--dm-primary);
}

/* =====================================================================
   Public marketing site (landing, privacy) — uses _PublicLayout
   ===================================================================== */
.public-page { background: #fff; color: #111827; }
.public-brand { font-weight: 800; font-size: 1.4rem; color: var(--dm-sidebar); letter-spacing: -.01em; text-decoration: none; }
.public-brand span { color: var(--dm-primary); }

.public-nav { background: rgba(255,255,255,.85); -webkit-backdrop-filter: saturate(180%) blur(10px); backdrop-filter: saturate(180%) blur(10px); border-bottom: 1px solid #eef0f4; padding: .65rem 0; }
.public-nav .nav-link { color: #475467; font-weight: 500; padding: .4rem .9rem; border-radius: 8px; }
.public-nav .nav-link:hover { color: var(--dm-primary); background: #f5f6fb; }

/* Hero */
.hero { position: relative; padding: 4.5rem 0 5rem; overflow: hidden;
    background: radial-gradient(1100px 520px at 78% -8%, #eef2ff 0%, rgba(238,242,255,0) 60%),
                linear-gradient(180deg, #fbfbff 0%, #ffffff 100%); }
.hero-eyebrow { display: inline-flex; align-items: center; font-size: .8rem; font-weight: 600; color: var(--dm-primary);
    background: #eef2ff; border: 1px solid #e0e4ff; padding: .35rem .8rem; border-radius: 999px; margin-bottom: 1.1rem; }
.hero-title { font-size: clamp(2.1rem, 4.6vw, 3.4rem); font-weight: 800; line-height: 1.08; letter-spacing: -.02em; color: #0f172a; margin-bottom: 1.1rem; }
.hero-lead { font-size: 1.13rem; color: #475467; max-width: 36rem; margin-bottom: 1.6rem; }
.hero-trust { display: flex; flex-wrap: wrap; gap: 1.1rem; color: #475467; font-size: .9rem; }

/* Hero CSS mockup */
.hero-mock { background: #fff; border: 1px solid #eaecf3; border-radius: 18px; box-shadow: 0 30px 60px -25px rgba(31,33,68,.35);
    overflow: hidden; transform: perspective(1400px) rotateY(-6deg) rotateX(2deg); }
.hero-mock-bar { display: flex; gap: .4rem; padding: .8rem 1rem; background: #f7f8fb; border-bottom: 1px solid #eef0f4; }
.hero-mock-bar span { width: 11px; height: 11px; border-radius: 50%; background: #d7dae3; }
.hero-mock-bar span:first-child { background: #ff5f57; }
.hero-mock-bar span:nth-child(2) { background: #febc2e; }
.hero-mock-bar span:nth-child(3) { background: #28c840; }
.hero-mock-body { display: grid; grid-template-columns: 1.5fr 1fr; gap: 1rem; padding: 1.1rem; }
.hero-mock-compose { background: #f9fafe; border: 1px solid #eef0f6; border-radius: 12px; padding: 1rem; }
.hmc-label { font-size: .72rem; font-weight: 700; color: var(--dm-primary); text-transform: uppercase; letter-spacing: .05em; margin-bottom: .8rem; }
.hmc-line { height: 9px; border-radius: 6px; background: linear-gradient(90deg, #e7e9f3, #f1f2f9); margin-bottom: .55rem; }
.hmc-chips { display: flex; gap: .4rem; margin-top: 1rem; }
.hmc-chip { width: 30px; height: 30px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center;
    background: #eef2ff; color: var(--dm-primary); font-size: .95rem; }
.hero-mock-side { display: flex; flex-direction: column; gap: .7rem; }
.hms-stat { background: #f9fafe; border: 1px solid #eef0f6; border-radius: 12px; padding: .7rem .85rem; }
.hms-stat-label { font-size: .68rem; text-transform: uppercase; letter-spacing: .05em; color: #98a2b3; font-weight: 600; }
.hms-stat-value { font-size: 1.5rem; font-weight: 700; color: #0f172a; line-height: 1.1; }
.hms-bars { display: flex; align-items: flex-end; gap: .35rem; height: 70px; padding: .5rem .2rem 0; }
.hms-bars span { flex: 1; border-radius: 4px 4px 0 0; background: linear-gradient(180deg, #818cf8, var(--dm-primary)); }

/* Section helpers */
.section-kicker { color: var(--dm-primary); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; font-size: .78rem; margin-bottom: .5rem; }
.section-title { font-size: clamp(1.6rem, 3vw, 2.3rem); font-weight: 800; letter-spacing: -.02em; color: #0f172a; }
.section-sub { color: #475467; max-width: 40rem; margin: .6rem auto 0; }

/* Platforms strip */
.platforms { padding: 2.5rem 0; border-top: 1px solid #f1f2f6; border-bottom: 1px solid #f1f2f6; background: #fcfcff; }
.platform-icons { display: flex; flex-wrap: wrap; justify-content: center; gap: 2rem; margin-top: 1rem; font-size: 2rem; color: #98a2b3; }
.platform-icons span { transition: color .15s ease, transform .15s ease; }
.platform-icons span:hover { color: var(--dm-primary); transform: translateY(-2px); }

/* Features + steps */
.features { padding: 5rem 0; }
.feature-card { background: #fff; border: 1px solid #eef0f4; border-radius: 16px; padding: 1.6rem; transition: box-shadow .18s ease, transform .18s ease, border-color .18s ease; }
.feature-card:hover { box-shadow: var(--dm-shadow-md); transform: translateY(-3px); border-color: #e0e4ff; }
.feature-icon { width: 48px; height: 48px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center;
    background: #eef2ff; color: var(--dm-primary); font-size: 1.4rem; margin-bottom: 1rem; }
.feature-title { font-size: 1.12rem; font-weight: 700; color: #0f172a; margin-bottom: .4rem; }
.feature-body { color: #475467; font-size: .96rem; margin-bottom: 0; }

.how { padding: 5rem 0; background: #fafbff; border-top: 1px solid #f1f2f6; }
.step-card { background: #fff; border: 1px solid #eef0f4; border-radius: 16px; padding: 1.6rem; }
.step-num { width: 40px; height: 40px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
    background: var(--dm-primary); color: #fff; font-weight: 700; margin-bottom: 1rem; }

/* CTA band */
.cta-band { padding: 4.5rem 0; background: linear-gradient(135deg, var(--dm-sidebar) 0%, var(--dm-primary-dark) 100%); color: #fff; }
.cta-title { font-size: clamp(1.6rem, 3vw, 2.3rem); font-weight: 800; letter-spacing: -.02em; }
.cta-sub { color: #c7d2fe; margin-bottom: 1.6rem; }

/* Footer */
.public-footer { background: #0f1230; color: #cbd2e0; padding: 3.5rem 0 2rem; }
.public-footer .public-brand { color: #fff; }
.footer-head { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: #8b93ad; font-weight: 700; margin-bottom: .9rem; }
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: .5rem; }
.footer-links a { color: #cbd2e0; text-decoration: none; font-size: .94rem; }
.footer-links a:hover { color: #fff; }

/* Legal pages */
.legal-page { padding: 3.5rem 0 5rem; }
.legal-page p { color: #475467; }

@media (max-width: 575.98px) {
    .hero-mock-body { grid-template-columns: 1fr; }
    .hero { padding: 3rem 0 3.5rem; }
}
