:root {
    --brand: #1f4fd8;
    --brand-indigo: #5b3df0;
    --brand-blue-300: #7d8cf5;
    --brand-indigo-300: #b6a7ff;
    --ink: #12141a;
    --text-muted: #59616f;
    --text-subtle: #7b8497;
    --border: #e2e5ea;
    --hairline: #eef0f3;
    --bg: #eef0f3;
    --surface: #ffffff;
    --accent-tint: #eaefff;

    --brand-gradient: linear-gradient(135deg, var(--brand), var(--brand-indigo));
    --shadow-sm: 0 1px 2px rgba(18, 20, 26, .05);
    --shadow-md: 0 4px 16px rgba(31, 79, 216, .08);
    --radius: 12px;

    /* legacy aliases so any older markup still resolves */
    --panel: var(--surface);
    --muted: var(--text-muted);
    --line: var(--border);
    --red: #d5271f;
    --amber: #b45309;
    --blue: var(--brand);
    --green: #15803d;
    --gray: var(--text-subtle);
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--ink);
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

.shell { display: flex; min-height: 100vh; }

.sidebar {
    width: 232px;
    background: var(--surface);
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    border-right: 1px solid var(--border);
}
.brand { padding: 22px 20px 18px; border-bottom: 1px solid var(--hairline); }
.brand-logo { height: 26px; width: auto; display: block; }
.brand small { display: block; margin-top: 8px; color: var(--text-subtle); font-size: 12px; letter-spacing: .2px; }
#navClose { display: none; }

/* legacy letter-mark, kept only so any stale cached view doesn't break */
.brand-mark {
    width: 34px; height: 34px; border-radius: 9px;
    background: var(--brand-gradient); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 16px;
}

/* The brand lockup (see helpers.php:brand_lockup()): mark + "Ajenti" reads as
   one logo, with a linked "by IngaboTech" credit tucked underneath. */
.brand-lockup { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-lockup .brand-words { display: flex; flex-direction: column; line-height: 1.05; }
.brand-lockup .brand-name {
    font-weight: 800; font-size: 19px; letter-spacing: -.4px; color: var(--text);
    background: var(--brand-gradient); -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent; color: transparent;
}
.brand-lockup .brand-by { font-size: 11px; font-weight: 500; color: var(--text-subtle); text-decoration: none; margin-top: 2px; }
.brand-lockup .brand-by:hover { color: var(--brand); text-decoration: underline; }

.sidebar nav { display: flex; flex-direction: column; padding: 12px; gap: 2px; flex: 1; }
.sidebar nav a {
    color: var(--text-muted); padding: 9px 14px; border-radius: 8px; text-decoration: none;
    font-size: 14px; font-weight: 500; transition: background .12s ease, color .12s ease;
    display: flex; align-items: center; gap: 10px;
}
.sidebar nav a:hover, .sidebar nav a.active { background: var(--accent-tint); color: var(--brand); }
.nav-group-label {
    font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px;
    color: var(--text-subtle); padding: 14px 14px 4px;
}
.nav-icon { width: 18px; height: 18px; flex-shrink: 0; }
.btn-icon { width: 16px; height: 16px; vertical-align: -3px; margin-right: 6px; }
.sidebar-footer {
    padding: 16px 20px; border-top: 1px solid var(--hairline);
    font-size: 13px; color: var(--text-subtle); display: flex; flex-direction: column; gap: 6px;
}
.sidebar-footer a { color: var(--brand); font-weight: 600; }

.main { flex: 1; padding: 28px 34px; max-width: 1200px; }

.page-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; gap: 12px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 22px; letter-spacing: -.2px; }

.card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 20px 22px; margin-bottom: 18px; box-shadow: var(--shadow-sm);
}
.card h2 { margin: 0 0 14px; font-size: 15px; font-weight: 700; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 18px 20px; box-shadow: var(--shadow-sm);
}
.stat .label { color: var(--text-subtle); font-size: 13px; font-weight: 500; }
.stat .value { font-size: 24px; font-weight: 700; margin-top: 6px; letter-spacing: -.3px; }
.stat .value a { color: inherit; }
.stat.alert { border-color: #f3c9c6; background: #fdf5f4; }
.stat.alert .value { color: var(--red); }

table { width: 100%; border-collapse: collapse; background: var(--surface); }
.card table { margin: 0 -22px; width: calc(100% + 44px); }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--hairline); }
th { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--text-subtle); font-weight: 700; }
tbody tr:hover td { background: var(--bg); }
tr:last-child td { border-bottom: none; }
td.num, th.num { text-align: right; }

.badge {
    display: inline-block; padding: 3px 10px; border-radius: 999px;
    font-size: 12px; font-weight: 600; letter-spacing: .1px;
}
.badge-green { background: #dcfce7; color: var(--green); }
.badge-blue  { background: var(--accent-tint); color: var(--brand); }
.badge-amber { background: #fef3c7; color: var(--amber); }
.badge-red   { background: #fbe4e2; color: var(--red); }
.badge-gray  { background: var(--hairline); color: var(--text-subtle); }

.btn {
    display: inline-block; background: var(--brand-gradient); color: #fff; border: none;
    padding: 10px 18px; border-radius: 9px; font-size: 14px; font-weight: 600;
    cursor: pointer; text-decoration: none; box-shadow: var(--shadow-md);
    transition: transform .08s ease, box-shadow .12s ease, opacity .12s ease;
}
.btn:hover { opacity: .94; text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-outline {
    background: var(--surface); color: var(--brand); border: 1px solid var(--border);
    box-shadow: none;
}
.btn-outline:hover { background: var(--accent-tint); border-color: var(--brand-blue-300); opacity: 1; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-danger { background: var(--red); box-shadow: none; }

form .field { margin-bottom: 14px; }
label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--ink); }
input[type=text], input[type=email], input[type=password], input[type=number],
input[type=date], select, textarea {
    width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px;
    font-size: 14px; font-family: inherit; background: var(--surface); color: var(--ink);
    transition: border-color .12s ease, box-shadow .12s ease;
}
input:focus, select:focus, textarea:focus {
    outline: none; border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--accent-tint);
}
textarea { min-height: 80px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 18px; }

.flash { padding: 12px 16px; border-radius: 9px; margin-bottom: 16px; font-weight: 500; font-size: 14px; }
.flash-success { background: #dcfce7; color: var(--green); }
.flash-error { background: #fbe4e2; color: var(--red); }

.login-wrap {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: var(--brand-gradient);
}
.login-card { background: var(--surface); border-radius: 16px; padding: 36px; width: 380px; max-width: calc(100vw - 32px); box-shadow: 0 20px 60px rgba(18,20,26,.25); }
.login-card .brand { padding: 0 0 22px; border-bottom: none; }
.login-card .brand-logo { height: 30px; }

.muted { color: var(--text-muted); }
.right { text-align: right; }
.mt { margin-top: 16px; }
.item-rows .row { display: grid; grid-template-columns: 1fr 90px 130px 90px 34px; gap: 8px; margin-bottom: 8px; align-items: center; }
.item-rows .head { font-size: 12px; color: var(--text-subtle); text-transform: uppercase; }

/* Point of Sale */
.pos-product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 12px; max-height: 480px; overflow-y: auto; }
.pos-product-tile {
    display: flex; flex-direction: column; gap: 2px; text-align: left; padding: 12px; border-radius: 10px;
    border: 1px solid var(--border); background: var(--surface); cursor: pointer; font-size: 13px;
}
.pos-product-tile:hover { border-color: var(--brand-blue-300); background: var(--accent-tint); }
.pos-product-tile .muted { font-size: 12px; }
.pos-search-results { position: relative; margin-top: 6px; }
.pos-search-item {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 8px 10px; border-bottom: 1px solid var(--hairline); font-size: 13px; cursor: pointer;
}
.pos-search-item:hover { background: var(--accent-tint); }
.pos-return-item { cursor: default; }
.pos-selected-chip {
    display: inline-flex; align-items: center; gap: 8px; margin-top: 8px; padding: 6px 12px;
    background: var(--accent-tint); color: var(--brand); border-radius: 999px; font-size: 13px; font-weight: 600;
}
.pos-selected-chip button { border: none; background: none; color: inherit; cursor: pointer; font-size: 14px; }
.pos-cart-rows .row { display: grid; grid-template-columns: 1.6fr 70px 90px 70px 90px 30px; gap: 8px; margin-bottom: 8px; align-items: center; font-size: 13px; }
.pos-cart-rows .head { font-size: 11px; color: var(--text-subtle); text-transform: uppercase; }
.pos-cart-rows input[type=number] { padding: 6px 8px; font-size: 13px; }
/* Purchase-order cart: one fewer column than POS (no discount %) */
.po-cart-rows.pos-cart-rows .row { grid-template-columns: 1.6fr 80px 110px 100px 30px; }
.pos-totals { width: 100%; margin-top: 10px; }
.pos-totals td { padding: 4px 0; }
.pos-totals .grand td { font-weight: 700; font-size: 15px; border-top: 1px solid var(--border); padding-top: 8px; }
.pos-tender-row { display: grid; grid-template-columns: 140px 1fr 34px; gap: 8px; margin-bottom: 8px; align-items: center; }

.mobile-topbar { display: none; }

@media (max-width: 800px) {
    .mobile-topbar {
        display: flex; align-items: center; justify-content: space-between;
        padding: 12px 16px; background: var(--surface); border-bottom: 1px solid var(--border);
        position: sticky; top: 0; z-index: 20;
    }
    .mobile-topbar .brand-logo { height: 22px; }
    .mobile-topbar button {
        background: none; border: 1px solid var(--border); border-radius: 8px;
        padding: 7px 9px; line-height: 0;
    }
    .mobile-topbar button svg { width: 20px; height: 20px; }

    .shell { flex-direction: column; }
    .sidebar {
        position: fixed; top: 0; left: 0; bottom: 0; width: 82%; max-width: 300px; z-index: 40;
        transform: translateX(-100%); transition: transform .2s ease; overflow-y: auto;
    }
    .sidebar.open { transform: translateX(0); }
    .sidebar .brand { display: flex; justify-content: space-between; align-items: center; }
    .sidebar .brand small { display: none; }
    #navClose { display: block; background: none; border: none; color: var(--text-subtle); padding: 4px; }
    #navClose svg { width: 18px; height: 18px; }
    .sidebar-backdrop {
        display: none; position: fixed; inset: 0; background: rgba(18,20,26,.45); z-index: 35;
    }
    .sidebar-backdrop.open { display: block; }
    .main { padding: 16px; }
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .item-rows .row { grid-template-columns: 1fr 1fr; }
    .item-rows .row .item-desc { grid-column: 1 / -1; }
    .card table { margin: 0 -16px; width: calc(100% + 32px); }
    .card { overflow-x: auto; }
    .pos-cart-rows .row { grid-template-columns: 1fr 60px 60px; }
    .pos-cart-rows .row span:nth-child(3), .pos-cart-rows .head span:nth-child(3) { display: none; }
}
@media print {
    .sidebar, .flash, .no-print { display: none !important; }
    .main { padding: 0; max-width: none; }
    body { background: #fff; }
    .card { border: none; box-shadow: none; }
}

/* Product tour */
.tour-overlay {
    display: none; position: fixed; inset: 0; background: rgba(18,20,26,.45); z-index: 998;
}
.tour-overlay.open { display: block; }
.tour-highlight {
    position: relative; z-index: 999; border-radius: 8px;
    box-shadow: 0 0 0 4px var(--brand), 0 0 0 9999px rgba(18,20,26,.45);
}
.tour-tooltip {
    display: none; position: absolute; z-index: 1000; width: 280px;
    background: var(--surface); border-radius: 12px; padding: 16px 18px;
    box-shadow: 0 20px 50px rgba(18,20,26,.35);
}
.tour-tooltip.open { display: block; }
.tour-tooltip .tour-title { font-weight: 700; font-size: 15px; margin-bottom: 6px; }
.tour-tooltip .tour-body { font-size: 13px; color: var(--text-muted); line-height: 1.5; }
.tour-tooltip .tour-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; }
.tour-tooltip .tour-actions button {
    border: none; background: none; cursor: pointer; font-size: 13px; font-weight: 600; padding: 6px 10px; border-radius: 6px;
}
.tour-tooltip .tour-skip { color: var(--text-subtle); }
.tour-tooltip .tour-back { color: var(--text-muted); }
.tour-tooltip .tour-actions button.tour-next { background: var(--brand); color: #fff; }
.tour-tooltip .tour-progress { margin-top: 10px; font-size: 11px; color: var(--text-subtle); text-align: right; }
@media (max-width: 640px) {
    .tour-tooltip { position: fixed; left: 16px !important; right: 16px; width: auto; top: auto !important; bottom: 16px; }
}

/* ===== Marketing pages: shared glassmorphism chrome (landing, signup, thanks) =====
   Reused across app/views/marketing/*.php so the public-facing pages share one
   visual language instead of each page re-styling its own nav/hero/cards. */
.mkt-body { background: var(--bg); overflow-x: hidden; }

.mkt-nav {
    position: fixed; top: 16px; left: 16px; right: 16px; z-index: 50;
    max-width: 1100px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between;
    padding: 12px 20px; border-radius: 999px;
    background: rgba(255,255,255,.65); border: 1px solid rgba(255,255,255,.6);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 8px 30px rgba(18,20,26,.08);
}
.mkt-nav .actions { display: flex; align-items: center; gap: 10px; }
.mkt-nav-spacer { height: 88px; }

.mkt-glow-field {
    position: relative; background: var(--brand-gradient); overflow: hidden;
}
.mkt-glow-field::before, .mkt-glow-field::after {
    content: ''; position: absolute; border-radius: 50%; filter: blur(60px); pointer-events: none;
}
.mkt-glow-field::before { width: 420px; height: 420px; background: rgba(255,255,255,.20); top: -140px; right: -80px; }
.mkt-glow-field::after { width: 320px; height: 320px; background: rgba(182,167,255,.35); bottom: -120px; left: -60px; }

.mkt-hero { position: relative; z-index: 1; color: #fff; text-align: center; padding: 150px 24px 110px; }
.mkt-hero h1 { font-size: 44px; font-weight: 800; margin: 0 0 18px; letter-spacing: -.7px; line-height: 1.15; }
.mkt-hero p { font-size: 18px; line-height: 1.6; opacity: .94; max-width: 620px; margin: 0 auto 30px; }
.mkt-hero .btn { background: #fff; color: var(--brand); font-size: 16px; font-weight: 700; padding: 14px 30px; box-shadow: 0 10px 30px rgba(18,20,26,.2); }
.mkt-hero .btn:hover { background: #fff; opacity: .95; }
.mkt-hero .btn-ghost {
    color: #fff; border: 1px solid rgba(255,255,255,.5); background: rgba(255,255,255,.12);
    backdrop-filter: blur(8px); font-size: 16px; font-weight: 600; padding: 14px 26px; border-radius: 10px;
    display: inline-flex; align-items: center; gap: 8px; margin-left: 10px;
}
.mkt-hero .btn-ghost:hover { background: rgba(255,255,255,.2); }
.mkt-hero-ctas { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px; }

.mkt-pill-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 40px; }
.mkt-pill {
    display: flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 999px;
    background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.28);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    color: #fff; font-size: 13px; font-weight: 500;
}
.mkt-pill svg { width: 16px; height: 16px; flex-shrink: 0; }
.mkt-pill-light {
    display: inline-flex; align-items: center; padding: 8px 16px; border-radius: 999px;
    background: var(--accent-tint); border: 1px solid var(--border); color: var(--brand);
    font-size: 13px; font-weight: 600;
}

.mkt-section { max-width: 1120px; margin: 0 auto; padding: 76px 24px; position: relative; z-index: 1; }
.mkt-section-head { text-align: center; max-width: 640px; margin: 0 auto 44px; }
.mkt-eyebrow {
    display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase;
    color: var(--brand); background: var(--accent-tint); padding: 5px 12px; border-radius: 999px; margin-bottom: 14px;
}
.mkt-section-head h2 { font-size: 30px; font-weight: 800; letter-spacing: -.5px; margin: 0 0 12px; }
.mkt-section-head p { color: var(--text-muted); font-size: 16px; line-height: 1.6; margin: 0; }

.glass-card {
    background: rgba(255,255,255,.72); border: 1px solid rgba(255,255,255,.9);
    border-radius: 18px; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 10px 40px rgba(31,79,216,.08);
}

.mkt-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.mkt-step { padding: 30px 26px; }
.mkt-step .num {
    width: 40px; height: 40px; border-radius: 12px; background: var(--brand-gradient); color: #fff;
    display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 17px; margin-bottom: 18px;
}
.mkt-step h3 { font-size: 17px; margin: 0 0 8px; }
.mkt-step p { color: var(--text-muted); font-size: 14px; line-height: 1.6; margin: 0; }

.mkt-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; }
.mkt-card { padding: 28px 26px; }
.mkt-card.core { border-color: var(--brand); box-shadow: 0 14px 40px rgba(31,79,216,.16); position: relative; }
.mkt-card .mkt-card-icon {
    width: 46px; height: 46px; border-radius: 12px; background: var(--accent-tint); color: var(--brand);
    display: flex; align-items: center; justify-content: center; margin-bottom: 16px;
}
.mkt-card.core .mkt-card-icon { background: var(--brand-gradient); color: #fff; }
.mkt-card-icon svg { width: 24px; height: 24px; }
.mkt-card h3 { margin: 0 0 4px; font-size: 18px; }
.mkt-card .price { font-size: 26px; font-weight: 800; margin: 14px 0 14px; color: var(--brand); }
.mkt-card .price small { font-size: 13px; font-weight: 500; color: var(--text-subtle); }
.mkt-card ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.mkt-card ul li { display: flex; align-items: flex-start; gap: 9px; font-size: 14px; color: var(--text-muted); line-height: 1.4; }
.mkt-card ul li svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 2px; color: var(--brand); }
.mkt-badge {
    position: absolute; top: -12px; right: 22px; background: var(--brand-gradient); color: #fff;
    font-size: 11px; font-weight: 700; letter-spacing: .3px; padding: 5px 12px; border-radius: 999px;
}

.mkt-note {
    max-width: 720px; margin: 40px auto 0; text-align: center; font-size: 13px; color: var(--text-muted);
    display: flex; flex-wrap: wrap; gap: 10px 24px; justify-content: center;
}
.mkt-note span { display: inline-flex; align-items: center; gap: 6px; }
.mkt-note svg { width: 15px; height: 15px; color: var(--brand); }

.mkt-faq { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.mkt-faq-item { padding: 24px 26px; }
.mkt-faq-item h3 { font-size: 15px; margin: 0 0 8px; }
.mkt-faq-item p { color: var(--text-muted); font-size: 14px; line-height: 1.6; margin: 0; }

.mkt-cta { text-align: center; padding: 90px 24px; position: relative; z-index: 1; color: #fff; }
.mkt-cta h2 { font-size: 30px; font-weight: 800; margin: 0 0 14px; letter-spacing: -.5px; }
.mkt-cta p { opacity: .92; margin: 0 0 28px; font-size: 16px; }

.mkt-footer {
    text-align: center; padding: 36px 24px; color: var(--text-subtle); font-size: 13px;
    border-top: 1px solid var(--hairline); background: var(--surface);
}
.mkt-footer a { color: var(--text-subtle); }
.mkt-footer-cols {
    display: flex; flex-wrap: wrap; justify-content: center; gap: 36px;
    max-width: 640px; margin: 24px auto 0; text-align: left; line-height: 1.8;
}
.mkt-footer-cols strong { color: var(--text-muted); }
.mkt-footer-copyright { margin-top: 24px; opacity: .8; }

@media (max-width: 900px) {
    .mkt-steps { grid-template-columns: 1fr; }
    .mkt-faq { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    .mkt-nav { top: 10px; left: 10px; right: 10px; padding: 10px 14px; flex-wrap: wrap; gap: 8px; }
    .mkt-nav-spacer { height: 78px; }
    .mkt-hero { padding: 120px 18px 70px; }
    .mkt-hero h1 { font-size: 30px; }
    .mkt-hero p { font-size: 16px; }
    .mkt-hero-ctas { flex-direction: column; width: 100%; }
    .mkt-hero .btn-ghost { margin-left: 0; }
    .mkt-section { padding: 50px 18px; }
    .mkt-section-head h2 { font-size: 24px; }
}
