/* =========================================================
   MAA INVEST — Design tokens (v2: blue SaaS admin theme)
   Display/body: Inter + Plus Jakarta Sans for headings
   Palette: royal blue primary, soft tinted icon chips,
   near-white app background, white cards, high-contrast text.
   ========================================================= */

:root {
    --blue: #1D4ED8;
    --blue-dark: #163DAD;
    --blue-soft: #EAEDFF;
    --ink: #131A2C;
    --text-main: #1E2432;
    --text-muted: #6B7280;
    --bg: #F5F6FA;
    --card: #FFFFFF;
    --border: #E7E9F1;

    --green: #17A673;
    --green-soft: #E4F8EF;
    --purple: #7C5CFC;
    --purple-soft: #EFEAFF;
    --orange: #F5921E;
    --orange-soft: #FEF0DE;
    --teal: #1BB6C7;
    --teal-soft: #E1F7F9;
    --pink: #F2545B;
    --pink-soft: #FDE7E8;
    --gold: #F5921E;
    --gold-soft: #FEF0DE;
    --ink-soft: #1B2540;
    --danger: #E0483E;

    --radius-lg: 18px;
    --radius-md: 14px;
    --radius-sm: 10px;
    --shadow-card: 0 1px 2px rgba(19,26,44,0.03), 0 10px 24px -14px rgba(19,26,44,0.14);
}

* { box-sizing: border-box; }

body {
    background: var(--bg);
    color: var(--text-main);
    font-family: 'Inter', system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .font-display {
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
    letter-spacing: -0.015em;
    color: var(--ink);
}

.font-mono, .money {
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
}

/* ---- Topbar ---- */
.topbar {
    height: 68px; background: var(--card); border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between; padding: 0 26px;
    position: sticky; top: 0; z-index: 20;
}
.topbar .search-box {
    flex: 1; max-width: 480px; display: flex; align-items: center; gap: 10px;
    background: var(--bg); border: 1px solid var(--border); border-radius: 12px;
    padding: 9px 14px; color: var(--text-muted); font-size: 14px; margin: 0 24px;
}
.topbar .icon-btn {
    position: relative; width: 38px; height: 38px; border-radius: 10px; display: flex;
    align-items: center; justify-content: center; background: var(--bg); border: 1px solid var(--border);
    color: var(--text-muted); cursor: pointer; text-decoration: none;
}
.topbar .icon-btn .badge {
    position: absolute; top: -5px; right: -5px; background: var(--pink); color: #fff;
    font-size: 10px; font-weight: 700; border-radius: 999px; padding: 1px 5px; min-width: 16px; text-align: center;
}

/* Layout shell */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
    width: 250px;
    background: var(--card);
    border-right: 1px solid var(--border);
    color: var(--text-main);
    flex-shrink: 0;
    position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.sidebar .brand { display:flex; align-items:center; gap:10px; padding: 20px 20px 16px; }
.sidebar .brand .mark {
    width: 34px; height: 34px; border-radius: 10px;
    background: linear-gradient(135deg, var(--blue), var(--purple));
    display:flex; align-items:center; justify-content:center; color:#fff; font-weight:800; font-size:14px;
}
.sidebar .group-label {
    font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
    color: #A0A6B8; padding: 16px 22px 6px;
}
.sidebar a {
    display: flex; align-items: center; gap: 11px;
    padding: 10px 14px; border-radius: var(--radius-sm);
    color: #4B5468; font-size: 14px; font-weight: 500;
    text-decoration: none; margin: 2px 12px;
    transition: background .15s ease, color .15s ease;
}
.sidebar a .ico { width:18px; text-align:center; }
.sidebar a:hover { background: var(--bg); color: var(--ink); }
.sidebar a.active {
    background: var(--blue); color: #fff;
    box-shadow: 0 6px 16px -6px rgba(59,91,255,0.55);
}
.sidebar .logout-row { padding: 14px 12px 20px; border-top: 1px solid var(--border); margin-top: 10px; }

.main-content { flex: 1; padding: 26px 30px; max-width: 1440px; }

/* Cards */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: 22px;
}

.stat-card { position: relative; overflow: hidden; }
.stat-card .stat-top { display:flex; justify-content:space-between; align-items:flex-start; }
.stat-card .stat-icon {
    width: 44px; height: 44px; border-radius: 12px; display:flex; align-items:center; justify-content:center; font-size:19px;
}
.stat-card .stat-label { font-size: 13px; color: var(--text-muted); font-weight: 500; margin-top: 14px; }
.stat-card .stat-value { font-size: 24px; font-weight: 700; margin-top: 4px; color: var(--ink); }
.stat-card .stat-delta { font-size: 12.5px; font-weight: 600; margin-top: 8px; }
.stat-card .stat-delta.up { color: var(--green); }
.stat-card .stat-delta.down { color: var(--pink); }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 18px; border-radius: 10px; font-weight: 600; font-size: 14px;
    cursor: pointer; border: none; transition: transform .1s ease, opacity .15s ease, background .15s ease;
    text-decoration: none;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-dark); }
.btn-gold { background: var(--blue); color: #fff; }
.btn-gold:hover { background: var(--blue-dark); }
.btn-outline { background: #fff; border: 1px solid var(--border); color: var(--text-main); }
.btn-outline:hover { background: var(--bg); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: 6px 14px; font-size: 13px; border-radius: 8px; }
.btn-pill { border-radius: 999px; }

/* Forms */
.field label { display:block; font-size: 13px; font-weight: 600; color: var(--text-main); margin-bottom: 6px; }
.field input, .field select, .field textarea {
    width: 100%; padding: 11px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm);
    font-size: 14px; background: #fff; color: var(--text-main);
}
.field input:focus, .field select:focus, .field textarea:focus {
    outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft);
}
.field { margin-bottom: 16px; }

/* Progress ring */
.ring-wrap { position: relative; display: inline-flex; align-items: center; justify-content: center; }
.ring-wrap svg { transform: rotate(-90deg); }
.ring-bg { stroke: var(--border); fill: none; }
.ring-fg { stroke: var(--blue); fill: none; stroke-linecap: round; transition: stroke-dashoffset .6s ease; }
.ring-center { position: absolute; text-align: center; font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 700; color: var(--ink); }

/* Progress bar */
.progress-track { background: var(--border); border-radius: 999px; height: 8px; overflow: hidden; }
.progress-fill { background: linear-gradient(90deg, var(--blue), var(--purple)); height: 100%; border-radius: 999px; transition: width .5s ease; }

/* Badges/pills */
.pill { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.pill-teal { background: var(--green-soft); color: #0F7A55; }
.pill-gold { background: var(--orange-soft); color: #A15D0A; }
.pill-danger { background: var(--pink-soft); color: var(--danger); }
.pill-muted { background: #EEF0F5; color: var(--text-muted); }
.pill-blue { background: var(--blue-soft); color: var(--blue-dark); }

/* Table */
table.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); padding: 10px 12px; border-bottom: 1px solid var(--border); }
.data-table td { padding: 12px; border-bottom: 1px solid var(--border); }
.data-table tr:last-child td { border-bottom: none; }

/* ---- Auth pages (split screen: dark gradient panel + white form panel) ---- */
.auth-page { min-height: 100vh; display: flex; background: #fff; }

.auth-left {
    flex: 1.1; position: relative; overflow: hidden; padding: 48px 56px;
    background: linear-gradient(135deg, #0B1F5E 0%, #143A8C 50%, #1D4ED8 130%);
    display: flex; flex-direction: column; color: #fff;
    min-width: 0;
}
.auth-left::before {
    content: ""; position: absolute; width: 620px; height: 620px; border-radius: 50%;
    background: rgba(255,255,255,0.05); right: -180px; top: 140px; filter: blur(20px); z-index: 0;
}
.auth-dot-grid {
    position: absolute; top: 90px; right: 60px; width: 130px; height: 90px; z-index: 1;
    background-image: radial-gradient(rgba(255,255,255,0.35) 1.5px, transparent 1.5px);
    background-size: 16px 16px; opacity: 0.6;
}

@keyframes auth-float {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-14px); }
}
@keyframes auth-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}
@keyframes auth-sway {
    0%, 100% { transform: rotate(-2deg); }
    50% { transform: rotate(2deg); }
}

.auth-left .brand-row { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; position: relative; z-index: 2; }
.auth-left .brand-row span { font-size: 20px; font-weight: 800; font-family: 'Plus Jakarta Sans', sans-serif; letter-spacing: .02em; }
.auth-left h1 { font-size: 52px; font-weight: 800; line-height: 1.08; letter-spacing: -1.5px; color: #fff; margin: 0 0 18px; max-width: 460px; position: relative; z-index: 2; text-shadow: 0 2px 18px rgba(0,0,0,0.35); }
.auth-left h1 .hl { color: #5B8CFF; }
.auth-left > p.lead { color: #D7DEF7; font-size: 14.5px; max-width: 420px; line-height: 1.6; margin: 0; position: relative; z-index: 2; text-shadow: 0 1px 8px rgba(0,0,0,0.3); }

.auth-feature-list { display: flex; flex-direction: column; gap: 18px; max-width: 280px; position: relative; z-index: 2; }
.auth-feature-item {
    display: flex; gap: 12px; align-items: flex-start;
}
.auth-feature-icon {
    width: 42px; height: 42px; border-radius: 12px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center; font-size: 18px;
}
.auth-feature-item h4 { margin: 0 0 3px; font-size: 14.5px; font-weight: 700; color: #fff; }
.auth-feature-item p { margin: 0; font-size: 12px; color: #A9B6E8; line-height: 1.45; }

.auth-badge-row { display: flex; gap: 10px; position: relative; z-index: 2; flex-wrap: wrap; margin-top: auto; }
.auth-badge {
    background: rgba(8,14,46,0.55); backdrop-filter: blur(6px); border: 1px solid rgba(255,255,255,0.12);
    border-radius: 14px; padding: 13px 14px; text-align: center; flex: 1; min-width: 110px;
}
.auth-badge .ic { width: 32px; height: 32px; border-radius: 10px; display: flex; align-items: center; justify-content: center; margin: 0 auto 7px; font-size: 14px; }
.auth-badge span { display: block; font-size: 11px; font-weight: 600; color: #E4E9FA; line-height: 1.3; }

.auth-hero-img { display: block; margin-top: auto; align-self: center; max-width: 340px; width: 100%; filter: drop-shadow(0 24px 40px rgba(0,0,0,0.45)); animation: auth-float 6s ease-in-out infinite; }

.auth-hero-img-right { position: absolute; right: -10px; bottom: 0; align-self: auto; margin-top: 0; max-width: 380px; width: 52%; z-index: 3; }
@media (max-width: 1300px) { .auth-hero-img-right { display: none; } }

.auth-right { flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px 32px; background: #F7F8FC; position: relative; }
.auth-lang-picker {
    position: absolute; top: 24px; right: 28px; display: flex; align-items: center; gap: 6px;
    border: 1px solid var(--border); border-radius: 999px; padding: 7px 14px; font-size: 12.5px; color: var(--text-main);
}
.auth-card { width: 100%; max-width: 420px; background: #fff; border-radius: 28px; padding: 48px; box-shadow: 0 20px 60px rgba(0,0,0,0.08); }
.auth-card .brand-row { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 18px; }
.auth-card .brand-row span { font-size: 21px; font-weight: 800; color: var(--blue-dark); font-family: 'Plus Jakarta Sans', sans-serif; }
.auth-card h1 { text-align: center; font-size: 24px; margin: 0 0 6px; }
.auth-card p.sub { text-align: center; color: var(--text-muted); font-size: 13.5px; margin: 0 0 28px; }

.field-icon { position: relative; margin-bottom: 16px; }
.field-icon label { display: block; font-size: 13px; font-weight: 600; color: var(--text-main); margin-bottom: 6px; }
.field-icon .icon-wrap { position: relative; display: flex; align-items: center; }
.field-icon .icon-left { position: absolute; left: 14px; color: var(--text-muted); display: flex; pointer-events: none; }
.field-icon input {
    width: 100%; height: 60px; padding: 0 14px 0 42px; border: 1px solid var(--border); border-radius: 16px;
    font-size: 15px; background: #fff; color: var(--text-main);
}
.field-icon input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.field-icon .icon-right {
    position: absolute; right: 14px; color: var(--text-muted); cursor: pointer; background: none; border: none; display: flex; padding: 0;
}
.field-icon.has-phone-prefix input { padding-left: 96px; }
.phone-prefix {
    position: absolute; left: 40px; display: flex; align-items: center; gap: 4px; font-size: 13.5px; color: var(--text-main);
    padding-right: 8px; border-right: 1px solid var(--border);
}

.btn-block {
    width: 100%; height: 60px; font-size: 16px; font-weight: 700; border-radius: 16px;
    background: linear-gradient(135deg, #2563EB, #1D4ED8);
}
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 20px 0; color: var(--text-muted); font-size: 12px; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.btn-google {
    width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px;
    padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: #fff; color: var(--text-main);
    font-size: 14px; font-weight: 600; cursor: pointer;
}
.btn-google:hover { background: var(--bg); }
.auth-card .footer-link { text-align: center; margin-top: 20px; font-size: 13.5px; color: var(--text-muted); }
.auth-card .footer-link a { color: var(--blue); font-weight: 600; text-decoration: none; }
.auth-row-between { display: flex; justify-content: space-between; align-items: center; margin: -6px 0 20px; font-size: 12.5px; }
.auth-row-between label { display: flex; align-items: center; gap: 7px; color: var(--text-secondary, var(--text-muted)); cursor: pointer; }
.auth-row-between a { color: var(--blue); text-decoration: none; font-weight: 600; }
.auth-info-box {
    display: flex; gap: 10px; align-items: flex-start; background: var(--blue-soft); border-radius: 12px;
    padding: 12px 14px; margin-top: 24px; font-size: 12.5px; color: var(--blue-dark);
}
.auth-info-box a { color: var(--blue-dark); font-weight: 700; text-decoration: underline; }

.flash { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: 14px; }
.flash-error { background: var(--pink-soft); color: var(--danger); }
.flash-success { background: var(--green-soft); color: #0F7A55; }

/* ---- Marketing / landing page ---- */
.nav-public {
    display:flex; align-items:center; justify-content:space-between; padding: 18px 48px;
    background: #fff; border-bottom: 1px solid var(--border); position: sticky; top:0; z-index: 30;
}
.nav-public .links { display:flex; gap: 32px; }
.nav-public .links a { color:#3A4257; text-decoration:none; font-weight:500; font-size:14.5px; padding-bottom:6px; }
.nav-public .links a.active { color: var(--blue); border-bottom:2px solid var(--blue); }

.hero-eyebrow {
    display:inline-flex; align-items:center; gap:8px; background: var(--green-soft); color:#0F7A55;
    padding:6px 14px; border-radius:999px; font-size:13px; font-weight:600; margin-bottom:18px;
}

.feature-strip { display:flex; border:1px solid var(--border); border-radius:18px; background:#fff; box-shadow: var(--shadow-card); overflow:hidden; }
.feature-strip .feature-item { flex:1; display:flex; gap:12px; align-items:flex-start; padding: 22px 18px; border-right:1px solid var(--border); }
.feature-strip .feature-item:last-child { border-right:none; }
.feature-strip .feature-icon { width:36px; height:36px; border-radius:10px; display:flex; align-items:center; justify-content:center; font-size:16px; flex-shrink:0; }

.step-card { background:#fff; border:1px solid var(--border); border-radius:16px; padding:22px; text-align:left; position:relative; }
.step-num { width:30px; height:30px; border-radius:999px; display:flex; align-items:center; justify-content:center; font-weight:700; font-size:13px; margin-bottom: 14px; }

@media (max-width: 1000px) {
    .sidebar {
        display: flex; flex-direction: column;
        position: fixed; top: 0; left: 0; height: 100vh; width: 250px;
        z-index: 200;
        transform: translateX(-100%);
        transition: transform .25s ease;
    }
    .sidebar.mobile-open { transform: translateX(0); box-shadow: 24px 0 48px -24px rgba(15,23,42,.35); }
    .sidebar-backdrop {
        display: none; position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 150;
    }
    .sidebar-backdrop.show { display: block; }
    .icon-btn[aria-label="Menu"] { cursor: pointer; }
    .main-content { padding: 18px 16px; }
    .topbar { padding: 0 14px; }
    .topbar .search-box { flex: 1 1 auto; margin: 0 12px; max-width: none; }
    .auth-left { display: none; }
    .auth-right { width: 100%; padding: 32px 20px; }
    .auth-lang-picker { display: none; }
    .nav-public .links { display:none; }
    .feature-strip { flex-direction:column; }
    .feature-strip .feature-item { border-right:none; border-bottom:1px solid var(--border); }
}

/* Any dashboard page using an inline multi-column grid (stat cards etc.)
   collapses to 2 columns on tablets/phones, 1 on narrow phones — without
   having to hand-edit every page's inline style individually. */
@media (max-width: 640px) {
    [style*="grid-template-columns: repeat(5"],
    [style*="grid-template-columns: repeat(4"],
    [style*="grid-template-columns: repeat(3"] { grid-template-columns: 1fr 1fr !important; }
}
@media (max-width: 460px) {
    [style*="grid-template-columns: repeat(5"],
    [style*="grid-template-columns: repeat(4"],
    [style*="grid-template-columns: repeat(3"],
    [style*="grid-template-columns: repeat(2"] { grid-template-columns: 1fr !important; }
}

/* Defensive: stop any stray fixed-width element from forcing horizontal
   scroll on small screens. */
html, body { max-width: 100%; overflow-x: hidden; }