/* ============================================================
   Meliora Suite Hub — brand kit (mobile-first)
   Tokens echo the Meliora apps (Inter, green palette) so the
   whole suite feels like one product.
   ============================================================ */
:root {
    --green-900: #233a24;
    --green-700: #2f4a30;
    --green-600: #2f7a34;
    --green-500: #43a047;
    --accent: #43a047;
    --ink: #18271a;
    --muted: #5d6b5e;
    --line: #e3e8e3;
    --bg: #f4f7f4;
    --card: #ffffff;
    --radius: 20px;
    --radius-sm: 14px;
    --shadow-sm: 0 1px 2px rgba(20,40,20,.06), 0 2px 8px rgba(20,40,20,.05);
    --shadow-md: 0 6px 22px rgba(20,40,20,.10);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    color: var(--ink);
    background: var(--bg);
    line-height: 1.5;
    min-height: 100dvh;
}
a { color: inherit; text-decoration: none; }
em { font-style: normal; color: var(--green-500); }
.muted { color: var(--muted); }
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 18px; }

/* ── Top bar ───────────────────────────────────────────── */
.topbar {
    background: linear-gradient(120deg, var(--green-700), var(--green-500));
    color: #fff;
    box-shadow: var(--shadow-md);
}
.topbar-inner { display: flex; align-items: center; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 11px; font-weight: 800; font-size: 19px; letter-spacing: .2px; }
.brand-logo { width: 38px; height: 38px; border-radius: 10px; background: #fff; padding: 3px; object-fit: contain; box-shadow: 0 1px 3px rgba(0,0,0,.18); }
.brand small { display: block; font-weight: 500; font-size: 11px; opacity: .85; letter-spacing: .4px; }

/* ── Hero ──────────────────────────────────────────────── */
.hero {
    background:
        radial-gradient(1200px 300px at 50% -120px, rgba(67,160,71,.18), transparent 70%),
        var(--bg);
    text-align: center;
    padding: 44px 0 26px;
}
.hero h1 { margin: 0 0 8px; font-size: clamp(28px, 6vw, 46px); font-weight: 800; letter-spacing: -.5px; }
.hero-sub { margin: 0 auto; max-width: 560px; color: var(--muted); font-size: clamp(15px, 2.4vw, 18px); }

.search { position: relative; max-width: 460px; margin: 22px auto 0; }
.search-ico { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); opacity: .55; font-size: 16px; }
.search input {
    width: 100%; height: 50px; padding: 0 16px 0 44px;
    border: 1px solid var(--line); border-radius: 999px; background: #fff;
    font-size: 16px; box-shadow: var(--shadow-sm); outline: none; transition: border-color .15s, box-shadow .15s;
}
.search input:focus { border-color: var(--green-500); box-shadow: 0 0 0 4px rgba(67,160,71,.15); }

/* ── Category sections ─────────────────────────────────── */
.cat { margin: 30px 0 6px; }
.cat-title { font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); margin: 0 0 14px; }

/* ── App grid + cards ──────────────────────────────────── */
.app-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}
@media (min-width: 560px) { .app-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 860px) { .app-grid { grid-template-columns: repeat(3, 1fr); } }

.app-card {
    display: flex; flex-direction: column;
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 18px; box-shadow: var(--shadow-sm);
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s;
}
.app-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: #d4ddd4; }
.app-top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 12px; }
.app-icon { width: 56px; height: 56px; border-radius: 14px; display: block; }
.app-name { margin: 0 0 4px; font-size: 18px; font-weight: 700; }
.app-tag { margin: 0 0 16px; color: var(--muted); font-size: 14px; flex: 1; }
.app-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ── Badges ────────────────────────────────────────────── */
.badge { font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 999px; letter-spacing: .3px; }
.badge-new { background: #e7f6e8; color: var(--green-600); }
.badge-popular { background: #fff1e0; color: #b06a12; }

/* ── Buttons ───────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    height: 42px; padding: 0 18px; border-radius: 11px; font-weight: 600; font-size: 14px;
    border: 1px solid transparent; cursor: pointer; transition: filter .15s, background .15s, border-color .15s;
}
.btn-primary { background: var(--green-600); color: #fff; }
.btn-primary:hover { filter: brightness(1.06); }
.btn-ghost { background: #fff; color: var(--green-600); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--green-500); background: #f6fbf6; }

/* ── Empty / error ─────────────────────────────────────── */
.empty { text-align: center; color: var(--muted); padding: 40px 0; }
.error-box { max-width: 440px; margin: 60px auto; text-align: center; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 36px 26px; box-shadow: var(--shadow-sm); }
.error-emoji { font-size: 44px; }
.error-box h1 { font-size: 22px; margin: 8px 0 6px; }
.error-box .btn { margin-top: 18px; }

/* ── Footer ────────────────────────────────────────────── */
.footer { margin-top: 40px; border-top: 1px solid var(--line); background: #fff; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 20px 18px; font-size: 13px; color: var(--muted); padding-bottom: calc(20px + var(--safe-bottom)); }
