:root {
    /* Bagisto storefront palette */
    --nav: #2368e7;
    /* navyBlue — primary / headings / footer */
    --nav-2: #131a54;
    /* lighter navy (hover) */
    --blue: #012a92;
    /* darkBlue — accent */
    --green: #40994A;
    /* darkGreen — available */
    --pink: #F85156;
    /* darkPink — alert */
    --ink: #2d303b;
    --text: #545a72;
    --muted: #8a90a6;
    --bg: #ffffff;
    --soft: #f6f6f8;
    --border: #E6E7EB;
    --card: #ffffff;
    --btn: #2563eb;
    /* royal-blue Launch button (per reference) */
    --btn-2: #1d4ed8;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Poppins", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    color: var(--text);
    /* Light "graph-paper" grid of squares across the whole background */
    background-color: var(--soft);
    background-image:
        linear-gradient(to right, rgba(6, 12, 59, 0.045) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(6, 12, 59, 0.045) 1px, transparent 1px);
    background-size: 40px 40px;
    background-attachment: fixed;
    /* grid stays put on scroll */
    -webkit-font-smoothing: antialiased;
    padding-bottom: 48px;
}

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

.am-shell {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ---- Top bar (in flow): logo left · icon buttons right ---- */
.am-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding-top: 16px;
    padding-bottom: 8px;
}

.am-logo img {
    height: 40px;
    width: auto;
    display: block;
}

@media (max-width: 600px) {
    .am-logo img {
        height: 32px;
    }
}

.am-actions-nav {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* icon button with a hover/focus tooltip (data-tip) */
.am-iconbtn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 11px;
    flex: 0 0 auto;
    color: var(--nav);
    background: #fff;
    border: 1px solid var(--border);
    transition: background .15s ease, border-color .15s ease, color .15s ease, transform .05s ease;
}

.am-iconbtn:hover {
    background: var(--soft);
    border-color: #c9d3ff;
    color: var(--blue);
}

.am-iconbtn:active {
    transform: translateY(1px);
}

.am-iconbtn::after {
    content: attr(data-tip);
    position: absolute;
    top: calc(100% + 9px);
    left: 50%;
    transform: translateX(-50%) translateY(-4px);
    background: var(--nav);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    padding: 5px 10px;
    border-radius: 7px;
    opacity: 0;
    pointer-events: none;
    z-index: 30;
    transition: opacity .15s ease, transform .15s ease;
}

.am-iconbtn:hover::after,
.am-iconbtn:focus-visible::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* keep the right-most tooltip inside the viewport */
.am-actions-nav .am-iconbtn:last-child::after {
    left: auto;
    right: 0;
    transform: translateY(-4px);
}

.am-actions-nav .am-iconbtn:last-child:hover::after {
    transform: translateY(0);
}

@media (max-width: 600px) {
    .am-iconbtn {
        width: 38px;
        height: 38px;
    }
}

/* ---- Main ---- */
main {
    display: block;
}

/* ---- Hero ---- */
.am-hero {
    padding: 0px 0 0px;
    text-align: center;
}

.am-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--blue);
    background: rgba(0, 68, 242, 0.07);
    border: 1px solid rgba(0, 68, 242, 0.16);
    padding: 6px 14px;
    border-radius: 999px;
    margin-bottom: 18px;
}

.am-eyebrow .spark {
    color: var(--pink);
    font-size: 13px;
}

.am-hero h1 {
    font-size: clamp(28px, 4vw, 42px);
    font-weight: 600;
    margin: 0 0 14px;
    letter-spacing: -0.01em;
    background: linear-gradient(94deg, #a8c6ff 0%, #000dff 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.am-highlight {
    background: linear-gradient(94deg, #000 0%, #1147bb 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

@media (max-width: 600px) {
    .am-hero h1 {
        font-size: 34px;
    }
}

.am-hero p {
    margin: 0 auto;
    max-width: 580px;
    color: var(--text);
    font-size: 15.5px;
}

/* ---- Toolbar ---- */
.am-toolbar {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    justify-content: space-between;
    margin: 30px 0 18px;
}

.am-search {
    position: relative;
    width: 100%;
    max-width: 520px;
    margin: 28px auto 0;
}

.am-search svg {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #a2a7ba;
    pointer-events: none;
}

.am-search input {
    width: 100%;
    font: inherit;
    font-size: 15px;
    padding: 10px 0px 10px 40px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    color: var(--ink);
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.am-search input:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(0, 68, 242, 0.12);
}

/* filter chips — availability (.am-fchip) + category (.am-cchip) */
.am-filters {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.am-catbar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin: 18px auto 0;
}

/* availability shown as COUNTS only (no filter) */
.am-counts {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    margin: 16px 0 0;
    font-size: 13px;
    color: var(--muted);
}

.am-counts strong {
    color: var(--ink);
    font-weight: 700;
}

.am-count-i {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.am-count-i .dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    display: inline-block;
}

.am-fchip,
.am-cchip {
    font: inherit;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 10px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text);
    transition: background .15s ease, border-color .15s ease, color .15s ease;
}

.am-fchip .n,
.am-cchip .n {
    font-weight: 700;
    font-size: 11.5px;
    line-height: 1;
    padding: 2px 7px;
    border-radius: 999px;
    background: var(--soft);
    color: var(--muted);
}

.am-fchip:hover,
.am-cchip:hover {
    border-color: #c9d3ff;
    color: var(--ink);
}

.am-fchip.is-active,
.am-cchip.is-active {
    background: var(--nav);
    border-color: var(--nav);
    color: #fff;
}

.am-fchip.is-active .n,
.am-cchip.is-active .n {
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
}

/* ---- Grid ---- */
.am-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin-top: 34px;
    padding-bottom: 12px;
}

@media (max-width: 900px) {
    .am-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .am-grid {
        grid-template-columns: 1fr;
    }
}

/* ---- Card ---- */
.am-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 18px 18px 18px;
    box-shadow: 0 4px 14px rgba(6, 12, 59, 0.05);
    transition: box-shadow .18s ease, transform .18s ease, border-color .18s ease;
}

.am-card:hover {
    border-color: #2762ea;
    box-shadow: 0 16px 34px rgba(6, 12, 59, 0.12);
    transform: translateY(-4px);
}

.am-card-inner {
    display: flex;
    gap: 8px;
    flex: 1 1 auto;
}

.am-card-top {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

/* top row: pastel letter avatar (left) + availability pill (right) */
.am-card-head {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 10px;
}

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

.am-icon {
    width: 40px;
    height: 40px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    font-size: 16px;
    letter-spacing: 0.5px;
    flex: 0 0 auto;
    background: hsl(var(--h, 220), 70%, 93%);
    /* soft tint */
    color: hsl(var(--h, 220), 55%, 42%);
    /* saturated letters */
}

.am-title {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.0;
    color: var(--ink);
    margin: 0;
}

.am-desc {
    margin: 20px 0px 10px 0px;
    font-size: 13.5px;
    line-height: 1.55;
    color: var(--text);
    flex: 1 1 auto;
}

.am-tags {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.am-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 10px;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 999px;
    white-space: nowrap;
}

.am-tag-available {
    color: var(--green);
    background: rgba(64, 153, 74, 0.12);
}

.am-tag-available .dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--green);
    display: inline-block;
}

/* pinned $priority modules — light red, gently pulsing to draw the eye */
.am-tag-popular {
    color: var(--pink);
    background: rgba(248, 81, 86, 0.12);
    animation: am-tag-breathe 1.8s ease-in-out infinite;
}

.am-tag-popular .dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--pink);
    display: inline-block;
    animation: am-pulse 1.8s ease-out infinite;
}

/* radiating ring off the dot — same idiom as the live badge on active-modules */
@keyframes am-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(248, 81, 86, 0.5); }
    70%  { box-shadow: 0 0 0 6px rgba(248, 81, 86, 0); }
    100% { box-shadow: 0 0 0 0 rgba(248, 81, 86, 0); }
}

/* the pill itself warms up and back — a soft blink, not a hard on/off flash */
@keyframes am-tag-breathe {
    0%, 100% { background: rgba(248, 81, 86, 0.12); }
    50%      { background: rgba(248, 81, 86, 0.28); }
}

/* honour a reduced-motion preference — keep the tag, drop the movement */
@media (prefers-reduced-motion: reduce) {
    .am-tag-popular,
    .am-tag-popular .dot {
        animation: none;
    }
}

/* per-card category chip (colour derived from the category) */
.am-cat {
    font-size: 12px;
    color: hsl(var(--c, 220), 45%, 40%);
}

.am-cat .dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: hsl(var(--c, 220), 55%, 45%);
}

.am-cat-other {
    color: #8a90a6;
    background: #eef0f3;
}

.am-cat-other .dot {
    background: #b7bdc7;
}

/* ---- Actions ---- */
.am-actions {
    display: flex;
    gap: 8px;
    align-items: stretch;
    justify-content: flex-end;
}

.am-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--btn);
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease, transform .05s ease;
}

.am-btn-disabled {
    opacity: .5;
    cursor: not-allowed;
    box-shadow: none;
}

/* ---- Empty state ---- */
.am-empty {
    display: none;
    text-align: center;
    padding: 60px 20px;
    color: var(--muted);
}

.am-empty.show {
    display: block;
}

.am-footer .am-shell {
    padding: 24px 0;
    text-align: right;
    font-size: 15px;
    color: var(--muted);
}

.am-footer .am-shell a {
    color: var(--nav);
    text-decoration: none;
}