/* ═══════════════════════════════════════
   DASHBOARD SHELL + WIDGETS
   ═══════════════════════════════════════ */

.layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100vh;
}
@media (max-width: 960px) {
    .layout { grid-template-columns: 1fr; }
    .sidebar { position: fixed; z-index: 100; transform: translateX(-100%); width: 280px; }
    .sidebar.open { transform: none; }
    .mobile-nav { display: flex !important; }
}

/* ─── Sidebar ───────────────────────────── */
.sidebar {
    background: var(--bg-2);
    border-right: 1px solid var(--border);
    padding: 22px 14px;
    display: flex; flex-direction: column;
    position: sticky; top: 0;
    height: 100vh; overflow-y: auto;
    transition: transform .25s ease;
}
.sidebar .brand-logo { padding: 0 10px 16px; }
.sidebar .lang-switcher {
    display: flex; gap: 4px; padding: 0 10px 16px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 8px;
}
.sidebar .lang-btn {
    background: transparent; border: 1px solid transparent;
    color: var(--text-2); padding: 4px 8px; border-radius: 6px;
    font-size: 15px; cursor: pointer; box-shadow: none;
    line-height: 1;
}
.sidebar .lang-btn:hover { background: var(--bg-3); box-shadow: none; transform: none; }
.sidebar .lang-btn.active { background: var(--bg-3); border-color: var(--brand); box-shadow: none; }
.sidebar .group-title {
    font-size: 10px;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 700;
    margin: 20px 12px 6px;
}
.sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar a {
    display: flex; align-items: center;
    gap: 12px;
    padding: 10px 12px;
    color: var(--text-2);
    text-decoration: none;
    border-radius: var(--r-sm);
    font-size: 14px;
    font-weight: 500;
    transition: background .12s ease, color .12s ease;
    position: relative;
}
.sidebar a:hover { background: var(--bg-3); color: var(--text); }
.sidebar a.active {
    background: rgba(124, 92, 255, 0.14);
    color: var(--text);
}
.sidebar a.active::before {
    content: "";
    position: absolute; left: 0; top: 20%; bottom: 20%;
    width: 3px; background: var(--brand-grad); border-radius: 3px;
}
.sidebar a .ico {
    width: 20px; height: 20px;
    display: grid; place-items: center;
    color: var(--text-3);
    flex-shrink: 0;
}
.sidebar a:hover .ico, .sidebar a.active .ico { color: var(--brand); }
.sidebar .footer-area {
    margin-top: auto;
    padding: 16px 10px 8px;
    border-top: 1px solid var(--border);
    display: flex; align-items: center; gap: 10px;
}
.sidebar .avatar {
    width: 34px; height: 34px;
    border-radius: 10px;
    background: var(--brand-grad);
    display: grid; place-items: center;
    color: white; font-weight: 700; font-size: 13px;
    flex-shrink: 0;
}
.sidebar .footer-info { flex: 1; min-width: 0; }
.sidebar .footer-info .name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar .footer-info .plan { font-size: 11px; color: var(--text-3); }
.sidebar .footer-info .plan.paid { color: var(--brand); font-weight: 700; }
.sidebar .logout-btn {
    background: none; border: none; color: var(--text-3);
    cursor: pointer; padding: 6px; border-radius: 6px;
    box-shadow: none;
}
.sidebar .logout-btn:hover { color: var(--danger); background: var(--bg-3); box-shadow: none; transform: none; }

/* ─── Main ───────────────────────────────── */
.main {
    padding: 32px 40px 60px;
    width: 100%;
    max-width: 1440px;
    animation: fadeInUp .3s ease;
}
@media (max-width: 780px) { .main { padding: 20px 16px 40px; } }

.mobile-nav {
    display: none;
    align-items: center; justify-content: space-between;
    padding: 14px 20px;
    background: var(--bg-2);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 50;
}
.mobile-nav .menu-btn {
    background: none; border: 1px solid var(--border);
    color: var(--text); padding: 8px 10px;
    border-radius: 8px; box-shadow: none;
}

.gsearch {
    background: linear-gradient(180deg, var(--bg-3), var(--bg-2));
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 10px 14px;
    margin-bottom: 20px;
}
.gsearch-inner { display: flex; gap: 8px; align-items: center; }
.gsearch input {
    background: var(--bg-2); border: 1px solid var(--border);
    padding: 10px 12px; font-size: 14px;
}
.gsearch input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(124,92,255,0.15); }
.gsearch-hint { margin-top: 8px; font-size: 12.5px; color: var(--text-2); min-height: 18px; }

.topbar {
    display: flex; align-items: flex-start;
    justify-content: space-between; gap: 20px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}
.topbar .hello h1 { margin: 0; }
.topbar .hello .sub { color: var(--text-2); font-size: 14px; margin-top: 4px; }
.topbar .actions { display: flex; gap: 10px; align-items: center; }

/* ─── Stat cards ─────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
    margin-bottom: 32px;
}
.stat {
    background: linear-gradient(180deg, var(--bg-3), var(--bg-2));
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 18px 20px;
    position: relative;
    overflow: hidden;
    transition: transform .15s ease, border-color .15s ease;
}
.stat:hover { transform: translateY(-2px); border-color: var(--border-2); }
.stat::before {
    content: ""; position: absolute; inset: 0;
    background: radial-gradient(600px 100px at 100% 0%, rgba(124, 92, 255, 0.15), transparent 60%);
    pointer-events: none;
}
.stat .label { font-size: 12px; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
.stat .value { font-size: 32px; font-family: "Space Grotesk", sans-serif; font-weight: 700; margin-top: 8px; letter-spacing: -0.02em; }
.stat .delta { font-size: 12px; color: var(--text-3); margin-top: 4px; }
.stat .delta.up   { color: var(--success); }
.stat .delta.down { color: var(--danger); }
.stat .ico {
    position: absolute; top: 14px; right: 16px;
    width: 32px; height: 32px;
    border-radius: 8px;
    background: rgba(124, 92, 255, 0.12);
    display: grid; place-items: center;
    color: var(--brand);
    font-size: 16px;
}

/* ─── Dashboard charts + widgets ─────────── */
.dash-charts {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}
@media (max-width: 900px) { .dash-charts { grid-template-columns: 1fr; } }
.dash-charts .card { padding: 20px; }
.card-head {
    display: flex; align-items: baseline; justify-content: space-between;
    margin-bottom: 12px; gap: 12px;
}
.card-head h3 { margin: 0; }
.card-head .small { font-size: 12px; }
.chart-wrap { position: relative; height: 260px; }

.dash-widgets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}
.dash-widgets .card { padding: 20px; }

/* Top filters ranking */
.rank-row { padding: 6px 0; }
.rank-head { display: flex; justify-content: space-between; margin-bottom: 4px; font-size: 13px; }
.rank-name { color: var(--text); font-weight: 500; }
.rank-count { color: var(--brand); font-weight: 700; font-family: "Space Grotesk", sans-serif; }
.rank-bar {
    height: 6px; background: var(--bg-4); border-radius: 3px; overflow: hidden;
}
.rank-bar > div {
    height: 100%; border-radius: 3px;
    background: linear-gradient(90deg, var(--brand), var(--brand-3));
    transition: width .3s ease;
}

/* Best deal widget */
.best-deal { display: flex; gap: 14px; }
.best-deal-thumb {
    flex: 0 0 100px; height: 130px;
    border-radius: 10px; background: var(--bg-3);
    background-size: cover; background-position: center;
    display: block;
}
.best-deal-body { flex: 1; min-width: 0; }
.best-deal-body .title { font-weight: 600; font-size: 14px;
    overflow: hidden; text-overflow: ellipsis; display: -webkit-box;
    -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.best-deal-body .price { font-size: 20px; font-weight: 700; font-family: "Space Grotesk", sans-serif; }
.savings-pill {
    display: inline-block;
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.35);
    padding: 4px 10px; border-radius: 999px;
    font-size: 12px; font-weight: 600;
    margin-top: 6px;
}

/* Price drops */
.drop-row {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; padding: 8px 0;
    border-bottom: 1px dashed var(--border);
}
.drop-row:last-child { border-bottom: none; }
.drop-title {
    color: var(--text); font-size: 13px; font-weight: 500;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    flex: 1; min-width: 0;
}
.drop-title:hover { color: var(--brand); }
.drop-info { display: flex; align-items: center; gap: 6px; font-size: 12px; }
.drop-old { color: var(--text-3); text-decoration: line-through; }
.drop-arrow { color: var(--text-3); }
.drop-new { color: var(--text); font-weight: 600; }

/* ─── Section headers ────────────────────── */
.section-head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 16px;
}
.section-head h2 { margin: 0; }

/* ─── Item cards ─────────────────────────── */
.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 18px;
}
/* Sur téléphone, la grille tombait en une seule colonne : la vignette 4/5
   prenait alors toute la largeur (~430 px de haut) et formait un gros bloc
   au-dessus de chaque carte. Deux colonnes + vignette carrée règlent ça sans
   toucher au desktop. Couvre aussi #deals-grid, qui réutilise .items-grid. */
@media (max-width: 640px) {
    .items-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .item-card .thumb { aspect-ratio: 1 / 1; }
    .item-card .body { padding: 10px 12px 12px; }
    .item-card .price { font-size: 17px; }
}
.item-card {
    background: linear-gradient(180deg, var(--bg-3), var(--bg-2));
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    overflow: hidden;
    display: flex; flex-direction: column;
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
    animation: fadeInUp .35s ease;
}
.item-card:hover {
    transform: translateY(-3px);
    border-color: var(--brand);
    box-shadow: var(--brand-glow);
}
.item-card .thumb {
    aspect-ratio: 4 / 5;
    background: var(--bg-3);
    background-size: cover;
    background-position: center;
    position: relative;
    display: block;
}
.item-card .thumb::after {
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(180deg, transparent 60%, rgba(0, 0, 0, 0.6));
}
.item-card .thumb .badge {
    position: absolute; top: 10px; left: 10px; z-index: 2;
    backdrop-filter: blur(8px);
    background: rgba(0, 0, 0, 0.4);
}
.item-card .thumb .badge.deal {
    background: rgba(16, 185, 129, 0.9);
    color: white; border: none;
}
.item-card .thumb .score-pill {
    position: absolute; top: 10px; right: 10px; z-index: 2;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    color: white;
    font-size: 11px; font-weight: 700;
    padding: 4px 10px; border-radius: 999px;
}
.item-card .body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 4px; }
.item-card .title {
    font-size: 14px; font-weight: 600;
    overflow: hidden; text-overflow: ellipsis;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    min-height: 2.6em;
    color: var(--text);
}
.item-card .meta {
    font-size: 12px; color: var(--text-3);
    display: flex; gap: 6px; flex-wrap: wrap; align-items: center;
    margin-top: 2px;
}
.item-card .meta span { display: inline-flex; align-items: center; gap: 3px; }
.item-card .price-row { display: flex; align-items: baseline; justify-content: space-between; margin-top: 8px; }
.item-card .price {
    font-size: 20px; font-weight: 700;
    font-family: "Space Grotesk", sans-serif;
    color: var(--text);
}
.item-card .price .avg { font-size: 11px; color: var(--text-3); font-weight: 400; margin-left: 4px; }
.item-card .time { font-size: 11px; color: var(--text-3); }
.item-card .actions { display: flex; gap: 6px; margin-top: 12px; }
.item-card .actions .btn { padding: 7px 12px; font-size: 12px; flex: 1; }
.item-card .actions .icon-btn {
    flex: 0 0 auto;
    padding: 7px 10px;
    background: var(--bg-4);
    border: 1px solid var(--border);
    color: var(--text-2);
    box-shadow: none;
}
.item-card .actions .icon-btn:hover { background: var(--brand); color: white; border-color: var(--brand); box-shadow: none; }

/* ─── Filter cards ───────────────────────── */
.filter-card {
    background: linear-gradient(180deg, var(--bg-3), var(--bg-2));
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 16px 20px;
    display: flex; align-items: center;
    gap: 14px; justify-content: space-between;
    transition: border-color .15s ease;
}
.filter-card:hover { border-color: var(--border-2); }
.filter-card.paused { opacity: 0.55; }
.filter-card .name { font-weight: 600; font-size: 15px; }
.filter-card .sub { font-size: 12.5px; color: var(--text-3); margin-top: 3px; display: flex; gap: 10px; flex-wrap: wrap; }
.filter-card .sub span { display: inline-flex; align-items: center; gap: 4px; }

/* ─── Forms grid ─────────────────────────── */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

/* ─── Pagination ─────────────────────────── */
.pagination {
    display: flex; gap: 6px;
    justify-content: center;
    margin-top: 28px;
}
.pagination button {
    background: var(--bg-3);
    color: var(--text);
    border: 1px solid var(--border);
    min-width: 36px; padding: 7px 12px;
    font-size: 13px; box-shadow: none;
}
.pagination button:hover { background: var(--bg-4); border-color: var(--brand); box-shadow: none; }
.pagination button.active {
    background: var(--brand-grad);
    color: white; border-color: transparent;
}

/* ─── Pricing ────────────────────────────── */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    margin: 32px 0;
}
.pricing-card {
    background: linear-gradient(180deg, var(--bg-3), var(--bg-2));
    border: 1px solid var(--border);
    border-radius: var(--r-xl);
    padding: 28px;
    display: flex; flex-direction: column; gap: 16px;
    position: relative;
    transition: transform .2s ease, border-color .2s ease;
}
.pricing-card:hover { transform: translateY(-4px); }
.pricing-card.featured {
    border-color: var(--brand);
    box-shadow: var(--brand-glow);
}
.pricing-card.featured::before {
    content: "Populaire";
    position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
    background: var(--brand-grad); color: white;
    padding: 4px 12px; border-radius: 999px;
    font-size: 11px; font-weight: 700;
    letter-spacing: 0.05em; text-transform: uppercase;
}
.pricing-card h3 { font-size: 20px; margin-bottom: 4px; }
.pricing-card .price {
    font-family: "Space Grotesk", sans-serif;
    font-size: 40px; font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1;
}
.pricing-card .price small { font-size: 14px; color: var(--text-3); font-weight: 500; }
.pricing-card ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.pricing-card ul li {
    color: var(--text-2); font-size: 13.5px;
    display: flex; align-items: center; gap: 8px;
}
.pricing-card ul li::before {
    content: "✓"; color: var(--brand); font-weight: 800;
    display: inline-block; width: 16px; text-align: center;
}
.pricing-card .cta { margin-top: auto; }
