:root {
    --bg: #eef4ff;
    --surface: rgba(255, 255, 255, .82);
    --surface-solid: #ffffff;
    --text: #0f172a;
    --muted: #64748b;
    --line: rgba(148, 163, 184, .28);
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --shadow: 0 24px 70px rgba(15, 23, 42, .12);
    --radius: 24px;
    --sidebar-width: 292px;
}

[data-theme="dark"] {
    --bg: #08111f;
    --surface: rgba(15, 23, 42, .78);
    --surface-solid: #111c2f;
    --text: #e5edf8;
    --muted: #9fb0c8;
    --line: rgba(148, 163, 184, .18);
    --primary: #60a5fa;
    --primary-dark: #3b82f6;
    --shadow: 0 24px 70px rgba(0, 0, 0, .28);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 92px; }
body {
    margin: 0;
    min-height: 100vh;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, .20), transparent 32rem),
        radial-gradient(circle at top right, rgba(14, 165, 233, .18), transparent 28rem),
        var(--bg);
}

a { color: inherit; text-decoration: none; }
button, input { font: inherit; }

.app-shell { display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); min-height: 100vh; }
.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 24px;
    border-right: 1px solid var(--line);
    background: rgba(255, 255, 255, .60);
    backdrop-filter: blur(20px);
    z-index: 20;
    display: flex;
    flex-direction: column;
}
[data-theme="dark"] .sidebar { background: rgba(8, 17, 31, .68); }

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: var(--surface);
}
.brand-logo, .app-icon {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 16px;
    color: #fff;
    background: linear-gradient(135deg, #2563eb, #06b6d4);
    box-shadow: 0 14px 28px rgba(37, 99, 235, .28);
}
.brand-logo { padding: 4px; overflow: hidden; background: rgba(79, 70, 229, .12); box-shadow: 0 14px 30px rgba(79, 70, 229, .22); }
.brand-logo img { width: 100%; height: 100%; object-fit: contain; display: block; filter: drop-shadow(0 8px 10px rgba(30, 27, 75, .24)); }
.brand strong { display: block; font-size: 17px; }
.brand span { display: block; margin-top: 2px; color: var(--muted); font-size: 13px; }

.menu { display: grid; gap: 8px; margin: 24px 0; }
.menu-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 14px;
    color: var(--muted);
    border-radius: 16px;
    transition: .2s ease;
}
.menu-link:hover, .menu-link.active { color: var(--text); background: var(--surface-solid); box-shadow: 0 10px 30px rgba(15, 23, 42, .08); }
.menu-link i { font-size: 21px; color: var(--primary); }

.sidebar-card {
    margin-top: auto;
    padding: 18px;
    border-radius: 22px;
    background: linear-gradient(135deg, rgba(37, 99, 235, .14), rgba(14, 165, 233, .12));
    border: 1px solid var(--line);
}
.sidebar-card i { font-size: 28px; color: var(--primary); }
.sidebar-card strong { display: block; margin: 10px 0 4px; }
.sidebar-card p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }

.main-content { min-width: 0; padding: 24px; }
.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: -24px -24px 24px;
    padding: 18px 24px;
    border-bottom: 1px solid var(--line);
    background: rgba(238, 244, 255, .72);
    backdrop-filter: blur(18px);
}
[data-theme="dark"] .topbar { background: rgba(8, 17, 31, .72); }
.topbar-title span { color: var(--muted); font-size: 13px; font-weight: 600; }
.topbar-title h1 { margin: 4px 0 0; font-size: clamp(22px, 3vw, 30px); letter-spacing: -.04em; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.topbar-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 14px;
    border-radius: 15px;
    color: var(--text);
    background: var(--surface-solid);
    border: 1px solid var(--line);
    font-weight: 800;
}
.topbar-link i { color: var(--primary); font-size: 19px; }
.icon-btn {
    display: inline-grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 1px solid var(--line);
    border-radius: 15px;
    color: var(--text);
    background: var(--surface-solid);
    cursor: pointer;
    transition: .2s ease;
}
.icon-btn:hover, .topbar-link:hover { transform: translateY(-1px); box-shadow: 0 12px 30px rgba(15, 23, 42, .10); }
.icon-btn i { font-size: 21px; }
.mobile-only { display: none; }

.hero { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr); gap: 22px; align-items: stretch; margin-bottom: 22px; }
.hero-content, .stats-grid, .toolbar, .help-section, .app-card, .info-card, .empty-state, .order-panel {
    border: 1px solid var(--line);
    background: var(--surface);
    backdrop-filter: blur(18px);
    box-shadow: var(--shadow);
}
.hero-content { padding: clamp(24px, 4vw, 42px); border-radius: var(--radius); overflow: hidden; position: relative; }
.hero-content::after {
    content: "";
    position: absolute;
    right: -90px;
    bottom: -110px;
    width: 260px;
    height: 260px;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(37, 99, 235, .18), rgba(14, 165, 233, .12));
}
.hero-logo { position: absolute; right: -62px; bottom: -86px; width: min(340px, 48vw); pointer-events: none; opacity: .16; transform: rotate(-8deg); z-index: 0; }
.hero-logo img { width: 100%; height: auto; display: block; filter: drop-shadow(0 26px 36px rgba(49, 46, 129, .45)); }
.hero-content > *:not(.hero-logo) { position: relative; z-index: 1; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; color: var(--primary); font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.hero h2, .section-heading h2, .help-section h2 { margin: 12px 0; font-size: clamp(28px, 4.6vw, 54px); line-height: 1.02; letter-spacing: -.06em; }
.help-section h2, .section-heading h2 { font-size: clamp(24px, 3vw, 34px); }
.hero p, .help-section p, .order-panel p { max-width: 740px; color: var(--muted); line-height: 1.75; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.btn { display: inline-flex; align-items: center; gap: 9px; padding: 13px 17px; border-radius: 16px; font-weight: 800; border: 1px solid var(--line); }
.btn.primary { color: #fff; background: linear-gradient(135deg, #2563eb, #06b6d4); }
.btn.secondary { background: var(--surface-solid); color: var(--text); }

.quick-menu { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-top: 24px; }
.quick-menu-card {
    display: grid;
    gap: 6px;
    min-height: 112px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255, 255, 255, .72);
    transition: .2s ease;
}
[data-theme="dark"] .quick-menu-card { background: rgba(15, 23, 42, .65); }
.quick-menu-card:hover { transform: translateY(-2px); box-shadow: 0 16px 42px rgba(15, 23, 42, .12); }
.quick-menu-card i { color: var(--primary); font-size: 24px; }
.quick-menu-card span { color: var(--muted); font-size: 12px; font-weight: 800; }
.quick-menu-card strong { font-size: 26px; line-height: 1; }

.stats-grid { display: grid; gap: 14px; padding: 18px; border-radius: var(--radius); }
.stat-card { position: relative; overflow: hidden; padding: 20px; border-radius: 20px; background: var(--surface-solid); border: 1px solid var(--line); }
.stat-card span { color: var(--muted); font-size: 13px; font-weight: 700; }
.stat-card strong { display: block; margin-top: 8px; font-size: 38px; letter-spacing: -.06em; }
.stat-card small { display: block; color: var(--muted); line-height: 1.45; max-width: 170px; }
.stat-card i { position: absolute; right: 18px; bottom: 16px; color: var(--primary); font-size: 34px; opacity: .28; }

.toolbar { display: grid; grid-template-columns: minmax(260px, 420px) 1fr; gap: 14px; align-items: center; padding: 16px; border-radius: 22px; margin-bottom: 22px; }
.search-box { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface-solid); }
.search-box i { color: var(--primary); font-size: 20px; }
.search-box input { width: 100%; border: 0; outline: 0; color: var(--text); background: transparent; }
.search-box input::placeholder { color: var(--muted); }
.filter-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { padding: 10px 13px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: var(--surface-solid); cursor: pointer; font-weight: 700; transition: .2s ease; }
.pill:hover, .pill.active { color: #fff; border-color: transparent; background: var(--primary); }

.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin: 24px 0 18px; }
.section-heading h2 { margin-bottom: 0; }
.result-counter { color: var(--muted); font-size: 14px; }
.result-counter strong { color: var(--text); }
.app-grid, .info-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.app-card, .info-card { display: flex; flex-direction: column; min-height: 310px; padding: 18px; border-radius: var(--radius); transition: .22s ease; }
.app-card:hover, .info-card:hover { transform: translateY(-4px); box-shadow: 0 30px 80px rgba(15, 23, 42, .16); }
.card-head, .card-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.app-icon { width: 54px; height: 54px; font-size: 26px; }
.status { display: inline-flex; align-items: center; gap: 6px; padding: 8px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; }
.status.ready { color: #047857; background: rgba(16, 185, 129, .14); }
.status.missing { color: #b91c1c; background: rgba(239, 68, 68, .14); }
.card-body { padding: 18px 0; flex: 1; }
.category { color: var(--primary); font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; }
.app-card h3, .info-card h3 { margin: 8px 0 10px; font-size: 21px; line-height: 1.22; letter-spacing: -.03em; }
.app-card p, .info-card p { margin: 0; color: var(--muted); line-height: 1.65; font-size: 14px; }
.tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 16px; }
.tags span { padding: 7px 9px; border-radius: 999px; color: var(--muted); background: rgba(148, 163, 184, .12); font-size: 12px; font-weight: 700; }
.open-link { display: inline-flex; align-items: center; justify-content: center; gap: 7px; width: 100%; min-height: 46px; padding: 12px 14px; border: 0; border-radius: 16px; color: #fff; background: linear-gradient(135deg, var(--card-start, #2563eb), var(--card-end, #06b6d4)); font-weight: 900; cursor: pointer; }
.open-link.disabled { opacity: .55; cursor: not-allowed; }
.empty-state { display: grid; place-items: center; text-align: center; padding: 46px 20px; border-radius: var(--radius); }
.empty-state i { color: var(--primary); font-size: 48px; }
.empty-state h3 { margin: 12px 0 4px; }
.empty-state p { margin: 0; color: var(--muted); }

.catalog-section { margin-top: 8px; }
.order-panel { display: grid; grid-template-columns: minmax(0, .8fr) minmax(280px, 1.2fr); gap: 18px; align-items: center; padding: 22px; border-radius: var(--radius); margin-bottom: 18px; }
.order-panel h3 { margin: 0 0 8px; font-size: 24px; letter-spacing: -.04em; }
.order-panel p { margin: 0; }
.order-steps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.order-steps span { display: flex; align-items: center; gap: 10px; padding: 14px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface-solid); font-weight: 800; color: var(--text); }
.order-steps i { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 999px; color: #fff; background: var(--primary); font-size: 15px; }

.color-violet { --card-start: #7c3aed; --card-end: #2563eb; }
.color-blue { --card-start: #2563eb; --card-end: #06b6d4; }
.color-emerald { --card-start: #059669; --card-end: #10b981; }
.color-orange { --card-start: #f97316; --card-end: #f59e0b; }
.color-pink { --card-start: #db2777; --card-end: #f472b6; }
.color-green { --card-start: #16a34a; --card-end: #84cc16; }
.color-amber { --card-start: #d97706; --card-end: #fbbf24; }
.color-cyan { --card-start: #0891b2; --card-end: #22d3ee; }
.color-indigo { --card-start: #4f46e5; --card-end: #818cf8; }
.color-slate { --card-start: #334155; --card-end: #64748b; }
.color-teal { --card-start: #0f766e; --card-end: #2dd4bf; }
.color-lime { --card-start: #65a30d; --card-end: #bef264; }
.color-purple { --card-start: #9333ea; --card-end: #c084fc; }
.color-rose { --card-start: #e11d48; --card-end: #fb7185; }
.color-red { --card-start: #dc2626; --card-end: #f97316; }

.backdrop { display: none; }

@media (max-width: 1320px) { .quick-menu { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1180px) {
    .app-grid, .info-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hero { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 880px) {
    .app-shell { display: block; }
    .mobile-only { display: inline-grid; }
    .sidebar { position: fixed; left: 0; transform: translateX(-105%); width: min(86vw, var(--sidebar-width)); transition: transform .24s ease; }
    .sidebar.is-open { transform: translateX(0); }
    .backdrop { position: fixed; inset: 0; z-index: 15; background: rgba(15, 23, 42, .45); backdrop-filter: blur(3px); }
    .backdrop.show { display: block; }
    .toolbar, .help-section, .order-panel { grid-template-columns: 1fr; }
    .topbar-link { display: none; }
}
@media (max-width: 640px) {
    .hero-logo { width: 250px; right: -82px; bottom: -58px; opacity: .12; }
    .main-content { padding: 16px; }
    .topbar { margin: -16px -16px 16px; padding: 14px 16px; }
    .hero-content, .help-section { padding: 20px; }
    .stats-grid, .app-grid, .info-grid, .quick-menu, .order-steps { grid-template-columns: 1fr; }
    .section-heading { align-items: flex-start; flex-direction: column; }
    .app-card, .info-card { min-height: auto; }
}
