/* ==================================================
   SurfWare – Premium Store Theme
   ================================================== */

:root, [data-theme="light"] {
    --bg: #f0f2f5;
    --bg-card: #ffffff;
    --text: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --accent: #4f46e5;
    --accent-hover: #4338ca;
    --accent-soft: rgba(79, 70, 229, 0.08);
    --success: #16a34a;
    --danger: #dc2626;
    --warning: #d97706;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 4px 12px rgba(15, 23, 42, 0.04);
    --shadow-lg: 0 8px 30px rgba(15, 23, 42, 0.1);
    --header-bg: rgba(255, 255, 255, 0.92);
    --input-bg: #ffffff;
    --sidebar-bg: #ffffff;
}

[data-theme="dark"] {
    --bg: #0b0d10;
    --bg-card: #15181e;
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --border: #2a2f3a;
    --accent: #818cf8;
    --accent-hover: #a5b4fc;
    --accent-soft: rgba(129, 140, 248, 0.12);
    --success: #4ade80;
    --danger: #f87171;
    --warning: #fbbf24;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.4), 0 4px 16px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.45);
    --header-bg: rgba(15, 18, 24, 0.92);
    --input-bg: #1a1e26;
    --sidebar-bg: #12151b;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--bg);
    background-size: cover;
    background-attachment: fixed;
    background-position: center;
    color: var(--text);
    line-height: 1.55;
    font-size: 15px;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--accent-hover); }

img { max-width: 100%; height: auto; display: block; }

.container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===== Header ===== */
.site-header {
    background: var(--header-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 14px 0;
    margin-bottom: 28px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.logo {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.03em;
}
.logo:hover { text-decoration: none; color: var(--text); }

.nav {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.nav a {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 8px;
    transition: background 0.15s, color 0.15s;
}
.nav a:hover {
    color: var(--text);
    background: var(--accent-soft);
    text-decoration: none;
}

.cart-link { position: relative; font-weight: 600; }
.cart-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    margin-left: 4px;
    border-radius: 99px;
    background: var(--accent);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
}

.theme-switch {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 7px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.15s;
}
.theme-switch:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* ===== Cards & layout ===== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 16px;
}

.page-title {
    font-size: 1.55rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 18px;
    color: var(--text);
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: var(--accent);
    color: #fff !important;
    border: none;
    padding: 10px 18px;
    border-radius: 9px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.12s, box-shadow 0.12s, background 0.15s;
    text-decoration: none !important;
    line-height: 1.2;
}
.btn:hover {
    background: var(--accent-hover);
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
    transform: translateY(-1px);
}
.btn-outline {
    background: transparent;
    color: var(--text) !important;
    border: 1px solid var(--border);
}
.btn-outline:hover {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--accent) !important;
    box-shadow: none;
}
.btn-sm { padding: 7px 12px; font-size: 0.8rem; border-radius: 7px; }
.btn-block { width: 100%; }
.btn-danger {
    background: var(--danger);
}
.btn-danger:hover {
    background: #b91c1c;
    box-shadow: 0 4px 14px rgba(220, 38, 38, 0.3);
}
.btn:disabled, .btn[disabled] {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ===== Forms ===== */
.form-group { margin-bottom: 16px; }
.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text);
}
.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--input-bg);
    color: var(--text);
    font-size: 0.95rem;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.form-control:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
textarea.form-control { resize: vertical; min-height: 80px; }
select.form-control { cursor: pointer; }

/* ===== Alerts ===== */
.alert {
    padding: 12px 16px;
    border-radius: 9px;
    margin-bottom: 16px;
    font-size: 0.9rem;
}
.alert-success {
    background: rgba(22, 163, 74, 0.12);
    color: var(--success);
    border: 1px solid rgba(22, 163, 74, 0.25);
}
.alert-error {
    background: rgba(220, 38, 38, 0.12);
    color: var(--danger);
    border: 1px solid rgba(220, 38, 38, 0.25);
}
.alert-info {
    background: var(--accent-soft);
    color: var(--accent);
    border: 1px solid rgba(79, 70, 229, 0.2);
}

/* ===== Badges ===== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 600;
}
.badge-pending { background: #fef3c7; color: #92400e; }
.badge-paid { background: #dbeafe; color: #1e40af; }
.badge-delivered { background: #dcfce7; color: #166534; }
.badge-cancelled { background: #fee2e2; color: #991b1b; }
.badge-refunded { background: #f3e8ff; color: #6b21a8; }
[data-theme="dark"] .badge-pending { background: #78350f; color: #fde68a; }
[data-theme="dark"] .badge-paid { background: #1e3a8a; color: #93c5fd; }
[data-theme="dark"] .badge-delivered { background: #14532d; color: #86efac; }
[data-theme="dark"] .badge-cancelled { background: #7f1d1d; color: #fca5a5; }

/* ===== Product grid ===== */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
}

.product-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
    display: flex;
    flex-direction: column;
}
.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: transparent;
}
.product-card .img-wrap {
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: linear-gradient(145deg, #f8fafc, #e2e8f0);
}
[data-theme="dark"] .product-card .img-wrap {
    background: linear-gradient(145deg, #1a1e26, #0f1218);
}
.product-card .img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}
.product-card:hover .img-wrap img {
    transform: scale(1.04);
}
.product-card .body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}
.product-card h3 {
    font-size: 0.95rem;
    font-weight: 650;
    line-height: 1.35;
}
.product-card h3 a { color: var(--text); }
.product-card h3 a:hover { color: var(--accent); text-decoration: none; }
.product-card .price {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--accent);
    letter-spacing: -0.02em;
    margin-top: auto;
}

/* Category / search bar */
.store-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 22px;
    padding: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow);
}
.cat-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.cat-pills a {
    padding: 8px 14px;
    border-radius: 99px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    background: transparent;
    border: 1px solid var(--border);
    transition: all 0.15s;
}
.cat-pills a:hover,
.cat-pills a.active {
    background: var(--accent);
    color: #fff !important;
    border-color: var(--accent);
    text-decoration: none;
}

/* ===== Tables ===== */
.table {
    width: 100%;
    border-collapse: collapse;
}
.table th,
.table td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}
.table th {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    font-weight: 700;
    background: transparent;
}
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: var(--accent-soft); }

/* ===== Footer ===== */
.site-footer {
    margin-top: 48px;
    padding: 28px 0;
    border-top: 1px solid var(--border);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.88rem;
}
.site-footer a { color: var(--text-muted); }
.site-footer a:hover { color: var(--accent); }

.custom-header-bar {
    background: var(--accent);
    color: #fff;
    padding: 10px 0;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 500;
}

/* ===== Admin layout ===== */
.admin-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 24px;
    margin-bottom: 40px;
}
.admin-sidebar {
    background: var(--sidebar-bg);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 12px;
    box-shadow: var(--shadow);
    position: sticky;
    top: 80px;
    align-self: start;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
}
.admin-sidebar a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-radius: 9px;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 2px;
    transition: all 0.12s;
}
.admin-sidebar a:hover {
    background: var(--accent-soft);
    color: var(--text);
    text-decoration: none;
}
.admin-sidebar a.active {
    background: var(--accent);
    color: #fff !important;
    font-weight: 600;
}
.nav-section-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-muted);
    margin: 14px 0 6px 8px;
    opacity: 0.85;
}
.nav-section-label:first-child { margin-top: 4px; }
.nav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 99px;
    background: #ef4444;
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
}
.admin-sidebar a.active .nav-badge {
    background: rgba(255,255,255,0.25);
}
.admin-content { min-width: 0; }

/* ===== Utilities ===== */
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.flex { display: flex; }
.gap-2 { gap: 12px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.w-full { width: 100%; }

.license-key-box {
    background-color: var(--bg-card) !important;
    color: var(--text) !important;
    border: 1px solid var(--border) !important;
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 8px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    word-break: break-all;
}

@media (max-width: 900px) {
    .admin-layout { grid-template-columns: 1fr; }
    .admin-sidebar {
        position: static;
        max-height: none;
        display: flex;
        flex-wrap: wrap;
        gap: 4px;
        padding: 10px;
    }
    .admin-sidebar a { margin: 0; }
    .nav-section-label { width: 100%; margin: 8px 0 4px; }
}

@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 14px;
    }
    .site-header { margin-bottom: 18px; }
    .page-title { font-size: 1.3rem; }
}

/* ===== Product detail ===== */
.product-detail {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 28px;
    align-items: start;
}
.product-gallery { position: sticky; top: 90px; }
.product-hero-img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
}
.product-hero-placeholder {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    background: linear-gradient(145deg, var(--bg), var(--border));
}
.product-price-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.product-price {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--accent);
    letter-spacing: -0.03em;
}
.product-desc {
    color: var(--text-muted);
    white-space: pre-wrap;
    margin-bottom: 18px;
    line-height: 1.6;
    font-size: 0.95rem;
}
.product-perks {
    list-style: none;
    margin: 0 0 20px;
    padding: 0;
}
.product-perks li {
    position: relative;
    padding: 6px 0 6px 22px;
    font-size: 0.88rem;
    color: var(--text-muted);
}
.product-perks li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--success);
    font-weight: 700;
}
.qty-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}
.qty-row label { font-weight: 600; font-size: 0.9rem; }
.qty-control {
    display: flex;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 9px;
    overflow: hidden;
}
.qty-btn {
    width: 38px;
    height: 38px;
    border: none;
    background: var(--bg);
    color: var(--text);
    font-size: 1.1rem;
    cursor: pointer;
}
.qty-btn:hover { background: var(--accent-soft); }
.qty-input {
    width: 56px;
    text-align: center;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

/* ===== Checkout ===== */
.checkout-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 22px;
    align-items: start;
}
.checkout-section-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 14px;
}
.pay-note {
    background: var(--accent-soft);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px;
}
.checkout-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}
.checkout-item-info {
    display: flex;
    align-items: center;
    gap: 12px;
}
.checkout-thumb {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--border);
}
.checkout-thumb-empty {
    background: var(--bg);
}
.checkout-hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 16px 0;
}
.coupon-row {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.coupon-applied {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(22, 163, 74, 0.1);
    border-radius: 9px;
    margin-bottom: 16px;
    font-size: 0.9rem;
}
.checkout-totals {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.checkout-grand {
    font-weight: 800;
    font-size: 1.15rem;
    margin-top: 8px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

/* ===== Interactive dashboard ===== */
.period-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.period-pill {
    padding: 6px 12px;
    border-radius: 99px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    border: 1px solid var(--border);
    background: var(--bg-card);
}
.period-pill:hover { text-decoration: none; color: var(--text); }
.period-pill.active {
    background: var(--accent);
    color: #fff !important;
    border-color: var(--accent);
}
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}
.kpi-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 18px;
    box-shadow: var(--shadow);
}
.kpi-card.kpi-warn { border-color: rgba(245, 158, 11, 0.5); }
.kpi-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 6px;
}
.kpi-value {
    font-size: 1.7rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text);
}
.kpi-card:first-child .kpi-value { color: var(--accent); }
.kpi-sub { font-size: 0.8rem; margin-top: 6px; }
.kpi-bar {
    height: 4px;
    background: var(--bg);
    border-radius: 99px;
    margin-top: 12px;
    overflow: hidden;
}
.kpi-bar span {
    display: block;
    height: 100%;
    background: var(--accent);
    border-radius: 99px;
}
.dash-two {
    display: grid;
    grid-template-columns: 1.3fr 0.7fr;
    gap: 18px;
    margin-bottom: 20px;
}
.bar-chart {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    height: 160px;
    padding-top: 10px;
}
.bar-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    height: 100%;
    cursor: default;
}
.bar-fill {
    width: 100%;
    max-width: 36px;
    background: linear-gradient(180deg, var(--accent), #6366f1);
    border-radius: 6px 6px 3px 3px;
    min-height: 4px;
}
.bar-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-top: 6px;
    text-align: center;
}
.bar-val {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-top: 2px;
}
.status-row { margin-bottom: 12px; }
.status-track {
    height: 8px;
    background: var(--bg);
    border-radius: 99px;
    overflow: hidden;
}
.status-fill {
    height: 100%;
    border-radius: 99px;
    width: 0;
}
.alert-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}
.alert-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 16px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    text-decoration: none !important;
    transition: transform 0.15s, box-shadow 0.15s;
}
.alert-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}
.alert-card strong { color: var(--text); font-size: 0.95rem; }
.alert-card span { color: var(--text-muted); font-size: 0.82rem; }
.alert-card-warn { border-left: 4px solid #f59e0b; }
.alert-card-danger { border-left: 4px solid #ef4444; }
.alert-card-info { border-left: 4px solid #3b82f6; }
.alert-card-ok { border-left: 4px solid #22c55e; }
.alert-card-purple { border-left: 4px solid #8b5cf6; }
.card-head {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
}

@media (max-width: 900px) {
    .product-detail,
    .checkout-grid,
    .dash-two {
        grid-template-columns: 1fr;
    }
    .product-gallery { position: static; }
}

/* ===== Dashboard bottom panels (spacious) ===== */
.dash-bottom {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 28px;
    align-items: start;
}
.dash-panel {
    padding: 0;
    overflow: hidden;
    min-height: 120px;
}
.dash-empty {
    padding: 24px 18px;
    margin: 0;
}
.dash-list {
    display: flex;
    flex-direction: column;
}
.dash-list-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
}
.dash-list-row:last-child {
    border-bottom: none;
}
.dash-list-main {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
}
.dash-order-main {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}
.dash-thumb {
    width: 36px;
    height: 36px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}
.dash-list-title {
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dash-list-title:hover {
    color: var(--accent);
    text-decoration: none;
}
.dash-list-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
.dash-order-id {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
    letter-spacing: -0.02em;
}
.dash-order-id:hover {
    color: var(--accent);
    text-decoration: none;
}
.dash-order-email {
    font-size: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 220px;
}
.dash-order-total {
    font-weight: 700;
    font-size: 0.9rem;
    white-space: nowrap;
}

@media (max-width: 1000px) {
    .dash-bottom {
        grid-template-columns: 1fr;
    }
}

/* ===== Admin products – card layout ===== */
.products-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 24px;
    padding: 14px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
}
.admin-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}
.admin-product-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    transition: transform 0.15s, box-shadow 0.15s;
}
.admin-product-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}
.admin-product-img {
    position: relative;
    aspect-ratio: 16 / 10;
    background: var(--bg);
    overflow: hidden;
}
.admin-product-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.admin-product-img-empty {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}
.admin-product-ribbon {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0,0,0,0.7);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 6px;
}
.admin-product-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}
.admin-product-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
.admin-cat-tag {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg);
    border: 1px solid var(--border);
    padding: 3px 8px;
    border-radius: 99px;
}
.admin-product-name {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.35;
    margin: 0;
    color: var(--text);
}
.admin-product-price {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--accent);
    letter-spacing: -0.02em;
}
.admin-product-sort {
    display: flex;
    align-items: center;
    gap: 10px;
}
.admin-product-sort label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    margin: 0;
}
.admin-product-sort input {
    width: 72px;
    padding: 6px 8px;
}
.admin-product-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: auto;
    padding-top: 4px;
}

/* ===== Appearance settings layout ===== */
.settings-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 820px;
}
.settings-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: var(--shadow);
}
.settings-card-head {
    padding: 18px 22px 12px;
    border-bottom: 1px solid var(--border);
}
.settings-card-head h2 {
    margin: 0 0 4px;
    font-size: 1.05rem;
    font-weight: 700;
}
.settings-card-head p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}
.settings-card-body {
    padding: 20px 22px 22px;
}
.settings-card-body .form-group {
    margin-bottom: 20px;
}
.settings-card-body .form-group:last-child {
    margin-bottom: 0;
}
.settings-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px 20px;
}
.toggle-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px 28px;
    margin-bottom: 20px;
}
.toggle-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    cursor: pointer;
    margin: 0;
}
.toggle-label input {
    width: 16px;
    height: 16px;
}
.field-hint {
    margin-top: 6px;
    font-size: 0.8rem;
    color: var(--text-muted);
}
.logo-preview-box {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 12px;
    padding: 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    max-width: 360px;
}
.logo-preview-img {
    max-height: 48px;
    width: auto;
    object-fit: contain;
}
.logo-remove {
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    cursor: pointer;
}
.settings-actions {
    padding: 8px 0 32px;
}
@media (max-width: 700px) {
    .settings-grid-2 {
        grid-template-columns: 1fr;
    }
}

.favicon-preview-img {
    width: 32px;
    height: 32px;
    object-fit: contain;
    border-radius: 6px;
    background: var(--bg);
    border: 1px solid var(--border);
}




/* Theme-aware logos */
.site-logo { max-height: 40px; width: auto; }
.site-logo-light { display: none !important; }
.site-logo-dark { display: inline-block !important; filter: none; }

/* Light theme + only dark (white) logo → invert so it becomes dark */
html[data-theme="light"] .site-logo-dark {
    filter: invert(1) hue-rotate(180deg) brightness(0.9);
}

/* Light theme + dedicated light logo present → show light, hide dark */
html[data-theme="light"] body:has(.site-logo-light) .site-logo-dark {
    display: none !important;
}
html[data-theme="light"] .site-logo-light {
    display: inline-block !important;
    filter: none !important;
}

/* Dark theme */
html[data-theme="dark"] .site-logo-dark {
    display: inline-block !important;
    filter: none !important;
}
html[data-theme="dark"] .site-logo-light {
    display: none !important;
}

/* ==================================================
   Admin shell – full-height sidebar
   ================================================== */
.admin-body {
    margin: 0;
    background: var(--bg);
}
.adm-shell {
    display: flex;
    min-height: 100vh;
}
.adm-sidebar {
    width: 240px;
    flex-shrink: 0;
    background: var(--sidebar-bg, var(--bg-card));
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 40;
}
.adm-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 18px 16px;
    border-bottom: 1px solid var(--border);
}
.adm-brand-link {
    display: flex;
    align-items: center;
    text-decoration: none !important;
}
.adm-brand-logo {
    max-height: 32px !important;
    width: auto;
}
.adm-brand-text {
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--text);
    letter-spacing: -0.03em;
}
.adm-sidebar-close {
    display: none;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.4rem;
    cursor: pointer;
    line-height: 1;
}
.adm-nav {
    flex: 1;
    padding: 12px 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.adm-nav-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    padding: 14px 12px 6px;
    opacity: 0.75;
}
.adm-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    color: var(--text-muted) !important;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none !important;
    transition: background 0.12s, color 0.12s;
}
.adm-nav-item:hover {
    background: var(--accent-soft);
    color: var(--text) !important;
}
.adm-nav-item.is-active {
    background: var(--accent);
    color: #fff !important;
    font-weight: 600;
}
.adm-nav-item.is-active .adm-badge {
    background: rgba(255,255,255,0.25);
    color: #fff;
}
.adm-ico {
    width: 20px;
    text-align: center;
    font-size: 0.95rem;
    opacity: 0.9;
    flex-shrink: 0;
}
.adm-badge {
    margin-left: auto;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 99px;
    background: #ef4444;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.adm-sidebar-foot {
    padding: 10px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.adm-nav-muted {
    font-size: 0.85rem !important;
}

.adm-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}
.adm-topbar {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 28px;
    border-bottom: 1px solid var(--border);
    background: var(--header-bg, var(--bg-card));
    position: sticky;
    top: 0;
    z-index: 30;
    backdrop-filter: blur(10px);
}
.adm-topbar-title {
    font-weight: 700;
    font-size: 1.05rem;
    flex: 1;
    letter-spacing: -0.02em;
}
.adm-topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}
.adm-menu-btn {
    display: none;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 12px;
    cursor: pointer;
    color: var(--text);
    font-size: 1rem;
}
.adm-content {
    padding: 28px 32px 48px;
    flex: 1;
}

/* Hide old admin layout leftovers if present */
.admin-layout { display: block; }
.admin-sidebar { display: none !important; }

/* Appearance tabs */
.settings-form-wide {
    max-width: 900px;
}
.settings-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 20px;
    padding: 6px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
}
.settings-tab {
    border: none;
    background: transparent;
    color: var(--text-muted);
    padding: 10px 16px;
    border-radius: 9px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.12s;
}
.settings-tab:hover {
    color: var(--text);
    background: var(--accent-soft);
}
.settings-tab.is-active {
    background: var(--accent);
    color: #fff;
}
.settings-panel {
    display: none;
}
.settings-panel.is-active {
    display: block;
}
.settings-body-spacious {
    padding: 28px 28px 32px !important;
}
.settings-body-spacious .form-group {
    margin-bottom: 24px !important;
}
.settings-body-spacious .form-group:last-child {
    margin-bottom: 0 !important;
}
.logo-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 8px;
}
.sticky-save {
    position: sticky;
    bottom: 0;
    padding: 16px 0 8px;
    background: linear-gradient(transparent, var(--bg) 30%);
    margin-top: 8px;
}

@media (max-width: 900px) {
    .adm-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        transform: translateX(-100%);
        transition: transform 0.2s ease;
        box-shadow: var(--shadow-lg);
    }
    body.adm-nav-open .adm-sidebar {
        transform: translateX(0);
    }
    .adm-menu-btn { display: inline-flex; }
    .adm-sidebar-close { display: inline-block; }
    .adm-content { padding: 20px 16px 40px; }
    .adm-topbar { padding: 12px 16px; }
    .logo-pair { grid-template-columns: 1fr; }
}
