:root {
    --sim-primary: #0d7a5f;
    --sim-primary-dark: #0a5e49;
    --sim-primary-light: #e6f4f0;
    --sim-accent: #f4a935;
    --sim-danger: #d64545;
    --sim-text: #1f2933;
    --sim-muted: #6b7280;
    --sim-border: #e5e7eb;
    --sim-bg: #f7f9fa;
    --sim-card: #ffffff;
    --sim-radius: 12px;
    --sim-radius-sm: 8px;
    --sim-shadow: 0 1px 3px rgba(16, 24, 40, .06), 0 1px 2px rgba(16, 24, 40, .04);
    --sim-shadow-lg: 0 10px 30px rgba(16, 24, 40, .08);
}

* { box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--sim-text);
    background: var(--sim-bg);
    font-size: 15px;
    line-height: 1.5;
}

a { color: var(--sim-primary-dark); text-decoration: none; }
a:hover { color: var(--sim-primary); }

.text-muted-2 { color: var(--sim-muted) !important; }

/* Header */
.site-header {
    background: #fff;
    border-bottom: 1px solid var(--sim-border);
    position: sticky;
    top: 0;
    z-index: 1030;
}
.site-header .navbar-brand { font-weight: 800; font-size: 1.35rem; color: var(--sim-primary-dark); letter-spacing: -.5px; }
.site-header .navbar-brand span { color: var(--sim-accent); }
.site-header .navbar-brand .brand-logo { height: 34px; width: 34px; object-fit: contain; flex: 0 0 auto; }
.site-header .nav-link { color: var(--sim-text); font-weight: 500; }
.site-header .nav-link:hover, .site-header .nav-link.active { color: var(--sim-primary); }

/* Search */
.search-form-hero { max-width: 720px; margin: 0 auto; }
.search-input-group { position: relative; }
.search-input-group .form-control {
    height: 56px;
    padding-left: 3rem;
    border-radius: var(--sim-radius);
    border: 2px solid var(--sim-border);
    font-size: 1.05rem;
}
.search-input-group .form-control:focus { border-color: var(--sim-primary); box-shadow: 0 0 0 .2rem rgba(13,122,95,.15); }
.search-input-group .bi-search {
    position: absolute; left: 1rem; top: 50%; transform: translateY(-50%);
    color: var(--sim-muted); font-size: 1.2rem; z-index: 5;
}
.suggestions-box {
    position: absolute; top: 100%; left: 0; right: 0; background: #fff;
    border: 1px solid var(--sim-border); border-radius: var(--sim-radius-sm);
    box-shadow: var(--sim-shadow-lg); z-index: 1050; max-height: 420px; overflow-y: auto;
    margin-top: 4px;
}
.suggestions-box .suggestion-item { display: flex; gap: .75rem; padding: .6rem .9rem; border-bottom: 1px solid #f3f4f6; align-items: center; }
.suggestions-box .suggestion-item:last-child { border-bottom: 0; }
.suggestions-box .suggestion-item:hover { background: var(--sim-primary-light); }
.suggestions-box img, .suggestions-box .thumb { width: 40px; height: 40px; object-fit: contain; border-radius: 6px; background: #f3f4f6; flex: 0 0 40px; }

/* Hero */
.hero {
    background: linear-gradient(160deg, #0d7a5f 0%, #0a5e49 100%);
    color: #fff;
    padding: 3.5rem 1rem 3rem;
}
.hero h1 { font-weight: 800; letter-spacing: -.6px; }
.hero p.lead { color: rgba(255,255,255,.85); }
.hero .search-input-group .form-control { border-color: transparent; }

/* Cards */
.card-sim { background: var(--sim-card); border: 1px solid var(--sim-border); border-radius: var(--sim-radius); box-shadow: var(--sim-shadow); }
.card-sim:hover { box-shadow: var(--sim-shadow-lg); }
.section-title { font-weight: 700; font-size: 1.2rem; letter-spacing: -.3px; }

/* Product card */
.product-card { height: 100%; display: flex; flex-direction: column; transition: transform .15s ease, box-shadow .15s ease; }
.product-card:hover { transform: translateY(-2px); }
.product-card .product-thumb {
    height: 150px; display: flex; align-items: center; justify-content: center;
    background: #fff; border-bottom: 1px solid var(--sim-border); border-radius: var(--sim-radius) var(--sim-radius) 0 0;
    overflow: hidden;
}
.product-card .product-thumb img { max-height: 130px; max-width: 90%; object-fit: contain; }
.product-card .product-body { padding: .9rem; flex: 1; display: flex; flex-direction: column; }
.product-card .product-name { font-weight: 600; font-size: .95rem; line-height: 1.3; color: var(--sim-text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-card .price-now { font-size: 1.3rem; font-weight: 800; color: var(--sim-primary-dark); }
.product-card .price-unit { font-size: .8rem; color: var(--sim-muted); }

/* Offer row */
.offer-row {
    display: flex; align-items: center; gap: 1rem;
    padding: 1rem; border: 1px solid var(--sim-border); border-radius: var(--sim-radius);
    background: #fff; margin-bottom: .75rem; flex-wrap: wrap;
}
.offer-row.best { border-color: var(--sim-primary); box-shadow: 0 0 0 1px var(--sim-primary); }
.offer-row .merchant-logo { width: 56px; height: 56px; border-radius: 10px; background: #f3f4f6; display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--sim-primary-dark); flex: 0 0 56px; }
.offer-row .offer-price { font-size: 1.35rem; font-weight: 800; color: var(--sim-primary-dark); }
.offer-row .offer-old { text-decoration: line-through; color: var(--sim-muted); font-size: .85rem; }

/* Badges */
.badge-sim { font-weight: 600; font-size: .72rem; padding: .35em .6em; border-radius: 6px; }
.badge-best { background: var(--sim-primary); color: #fff; }
.badge-unit { background: #e0f2fe; color: #075985; }
.badge-drop { background: #dcfce7; color: #166534; }
.badge-stale { background: #fef3c7; color: #92400e; }
.badge-inactive { background: #f3f4f6; color: #4b5563; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-info { background: #e0e7ff; color: #3730a3; }

/* Footer */
.site-footer { background: #fff; border-top: 1px solid var(--sim-border); margin-top: 3rem; padding: 2.5rem 0 1.5rem; color: var(--sim-muted); }
.site-footer h6 { color: var(--sim-text); font-weight: 700; }

/* Admin */
.admin-wrapper { display: flex; min-height: 100vh; }
.admin-sidebar {
    width: 260px; background: #0f172a; color: #cbd5e1; flex: 0 0 260px;
    position: fixed; top: 0; bottom: 0; left: 0; overflow-y: auto; z-index: 1040;
    transition: transform .2s ease;
}
.admin-sidebar .brand { padding: 1.1rem 1.25rem; font-weight: 800; font-size: 1.15rem; color: #fff; border-bottom: 1px solid rgba(255,255,255,.08); display: flex; align-items: center; gap: .5rem; }
.admin-sidebar .brand span { color: var(--sim-accent); }
.admin-sidebar .nav-section { padding: .9rem 1.25rem .3rem; font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: #64748b; font-weight: 700; }
.admin-sidebar .nav-link { color: #cbd5e1; padding: .5rem 1.25rem; display: flex; align-items: center; gap: .65rem; font-size: .9rem; border-left: 3px solid transparent; }
.admin-sidebar .nav-link:hover { background: rgba(255,255,255,.05); color: #fff; }
.admin-sidebar .nav-link.active { background: rgba(13,122,95,.18); color: #fff; border-left-color: var(--sim-primary); }
.admin-sidebar .nav-link i { font-size: 1.05rem; }
.admin-main { margin-left: 260px; flex: 1; min-width: 0; background: var(--sim-bg); }
.admin-topbar { background: #fff; border-bottom: 1px solid var(--sim-border); padding: .75rem 1.25rem; position: sticky; top: 0; z-index: 1020; }
.admin-content { padding: 1.5rem; }
.admin-overlay { display: none; }

.stat-card { background: #fff; border: 1px solid var(--sim-border); border-radius: var(--sim-radius); padding: 1.1rem; height: 100%; }
.stat-card .stat-value { font-size: 1.7rem; font-weight: 800; letter-spacing: -.5px; }
.stat-card .stat-label { color: var(--sim-muted); font-size: .82rem; }
.stat-card .stat-icon { width: 42px; height: 42px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; }

.table-sim th { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--sim-muted); font-weight: 700; border-bottom: 2px solid var(--sim-border); }
.table-sim td { vertical-align: middle; font-size: .9rem; }

.empty-state { text-align: center; padding: 3rem 1rem; color: var(--sim-muted); }
.empty-state i { font-size: 3rem; opacity: .4; }

@media (max-width: 991.98px) {
    .admin-sidebar { transform: translateX(-100%); }
    .admin-sidebar.show { transform: translateX(0); }
    .admin-main { margin-left: 0; }
    .admin-overlay.show { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 1035; }
}

@media (max-width: 575.98px) {
    .hero { padding: 2.25rem 1rem 2rem; }
    .hero h1 { font-size: 1.6rem; }
    .offer-row { gap: .6rem; }
    .offer-row .offer-price { font-size: 1.15rem; }
}
