@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root {
    --bg: #0b1021;
    --panel: #0f172a;
    --card: #ffffff;
    --text: #0f172a;
    --muted: #64748b;
    --accent: #3b82f6;
    --accent-2: #22d3ee;
    --border: rgba(148, 163, 184, 0.35);
}

body {
    margin: 0;
    font-family: 'Space Grotesk', 'Inter', system-ui, -apple-system, "Segoe UI", sans-serif;
    background: radial-gradient(circle at 10% 20%, rgba(34, 211, 238, 0.12), transparent 35%), radial-gradient(circle at 80% 0%, rgba(59, 130, 246, 0.1), transparent 35%), var(--bg);
    color: #e2e8f0;
    letter-spacing: -0.01em;
}

.layout-body {
    display: flex;
    min-height: 100vh;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.75), rgba(11, 16, 33, 0.95));
}

.public-layout {
    background: radial-gradient(circle at 20% 20%, rgba(74, 222, 128, 0.09), transparent 35%), radial-gradient(circle at 80% 0%, rgba(59, 130, 246, 0.1), transparent 35%), #0b1021;
    color: #e2e8f0;
}

.public-topbar {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.25rem 1.25rem 0.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 20;
}

.public-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.public-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.public-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem 1.25rem 2.5rem;
}

a {
    color: #2f5ed6;
    text-decoration: none;
}

.public-layout a {
    color: #93c5fd;
}

.muted {
    color: var(--muted);
    font-size: 0.9rem;
}

.auth-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: #f5f7fb;
}

.auth-container {
    width: min(360px, 90vw);
    background: #ffffff;
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: 0 20px 45px rgba(31, 41, 51, 0.12);
    box-sizing: border-box;
}

.auth-logo {
    display: block;
    width: 48px;
    height: 48px;
    margin: 0 auto 1.25rem;
    border-radius: 12px;
}

.auth-container h1 {
    margin: 0;
    font-size: 1.8rem;
    text-align: center;
}

.subtitle {
    text-align: center;
    color: #52606d;
    margin-bottom: 1.5rem;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.auth-form label {
    font-weight: 500;
}

.auth-form input {
    padding: 0.75rem;
    border: 1px solid #d2d6dc;
    border-radius: 8px;
    font-size: 1rem;
}

.auth-form button {
    padding: 0.85rem;
    background: linear-gradient(135deg, #3f8efc 0%, #1b61f2 100%);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.1s ease-in, box-shadow 0.1s ease-in;
}

.auth-form button:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(31, 97, 242, 0.25);
}

.alert {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.alert-error {
    background: #fde8e8;
    color: #c52f2f;
}

.hint {
    text-align: center;
    font-size: 0.85rem;
    color: #52606d;
    margin-top: 1.5rem;
}

.sidebar {
    width: 240px;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.95), rgba(14, 165, 233, 0.1));
    color: #e2e8f0;
    display: flex;
    flex-direction: column;
    padding: 1.5rem 1rem;
    box-shadow: 10px 0 24px rgba(10, 14, 28, 0.4);
    transition: transform 0.25s ease-in-out, box-shadow 0.2s ease;
    border-right: 1px solid rgba(148, 163, 184, 0.2);
}

.sidebar-brand {
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.brand-logo {
    width: 32px;
    height: 32px;
    border-radius: 8px;
}

.brand-title {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-link {
    padding: 0.75rem 1rem;
    border-radius: 12px;
    color: inherit;
    background: rgba(255, 255, 255, 0.04);
    transition: background 0.2s ease-out, transform 0.2s ease-out, border 0.2s ease-out;
    border: 1px solid transparent;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateX(4px);
    border-color: rgba(34, 211, 238, 0.2);
}

.nav-link.active {
    background: linear-gradient(135deg, #2563eb 0%, #0ea5e9 60%, #22d3ee 100%);
    color: #ffffff;
    box-shadow: 0 10px 24px rgba(34, 211, 238, 0.25);
}

.layout-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2.5rem;
    background: rgba(255, 255, 255, 0.06);
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.18);
    backdrop-filter: blur(10px);
}

.topbar h1 {
    margin: 0;
    font-size: 1.5rem;
    letter-spacing: -0.02em;
    color: #e2e8f0;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.sidebar-toggle {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #1f2933;
    font-size: 1.6rem;
}

.topbar nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    font-size: 0.95rem;
}

.user-info {
    color: #cbd5e1;
}

.logout-link {
    padding: 0.45rem 1.1rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    color: #e2e8f0;
    transition: background 0.2s ease-in, border 0.2s ease-in;
}

.logout-link:hover {
    background: rgba(255, 255, 255, 0.08);
}

.layout-content {
    padding: 2.5rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    box-sizing: border-box;
}

.card {
    background: var(--card);
    padding: 1.75rem;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
    box-sizing: border-box;
    color: var(--text);
    border: 1px solid rgba(148, 163, 184, 0.16);
}

.card h2 {
    margin-top: 0;
}

.logs-card {
    grid-column: 1 / -1;
}

.logs-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.logs-actions {
    display: flex;
    gap: 0.75rem;
}

.insights-button {
    padding: 0.6rem 1.2rem;
    border-radius: 10px;
    border: 1px solid #f59e0b;
    background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
    color: #ffffff;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.08s ease, box-shadow 0.12s ease;
    text-decoration: none;
    display: inline-block;
}

.insights-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(245, 158, 11, 0.25);
}

.stats-button {
    padding: 0.6rem 1.2rem;
    border-radius: 10px;
    border: 1px solid #8b5cf6;
    background: linear-gradient(135deg, #8b5cf6 0%, #a78bfa 100%);
    color: #ffffff;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.08s ease, box-shadow 0.12s ease;
    text-decoration: none;
    display: inline-block;
}

.stats-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(139, 92, 246, 0.25);
}

.refresh-button {
    padding: 0.6rem 1.2rem;
    border-radius: 10px;
    border: 1px solid #2563eb;
    background: linear-gradient(135deg, #2563eb 0%, #60a5fa 100%);
    color: #ffffff;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.08s ease, box-shadow 0.12s ease;
}

.refresh-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.25);
}

.table-wrapper {
    overflow-x: auto;
    border-radius: 12px;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.93rem;
}

.table thead {
    background: #f1f5ff;
}

.table th,
.table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.table tbody tr:hover {
    background: rgba(37, 99, 235, 0.05);
}

.table th {
    font-weight: 600;
    color: #334155;
}

.table td {
    color: #1f2937;
}

.ua-cell {
    max-width: 240px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.empty-state {
    text-align: center;
    padding: 2rem 1rem;
    color: #52606d;
}

@media (max-width: 720px) {
    .table {
        border-collapse: separate;
    }

    .table thead {
        display: none;
    }

    .table tbody {
        display: block;
    }

    .table tbody tr {
        display: block;
        margin-bottom: 1rem;
        padding: 1rem;
        border-radius: 14px;
        border: 1px solid rgba(15, 23, 42, 0.08);
        background: #ffffff;
        box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
    }

    .table tbody tr:last-child {
        margin-bottom: 0;
    }

    .table tbody tr td {
        display: block;
        padding: 0.35rem 0;
        border-bottom: none;
    }

    .table tbody tr td::before {
        content: attr(data-label);
        display: block;
        font-size: 0.75rem;
        font-weight: 600;
        letter-spacing: 0.04em;
        text-transform: uppercase;
        color: #475569;
        margin-bottom: 0.1rem;
    }

    .table tbody tr td.empty-state {
        padding: 1.25rem;
    }

    .table tbody tr td.empty-state::before {
        content: none;
    }

    .users-table-wrapper {
        border: none;
        padding: 0;
    }

    .users-actions {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        gap: 0.35rem;
    }

    .ua-cell {
        white-space: normal;
        word-break: break-word;
    }
}

.alert-success {
    background: #ecfdf3;
    color: #166534;
}

.users-grid {
    display: grid;
    grid-template-columns: minmax(280px, 340px) 1fr;
    gap: 1.5rem;
    align-items: flex-start;
}

.user-form-card {
    position: sticky;
    top: 2rem;
}

.user-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.user-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.user-form input[type="text"],
.user-form input[type="email"],
.user-form input[type="password"] {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d2d6dc;
    border-radius: 10px;
    font-size: 0.95rem;
    box-sizing: border-box;
}

.user-form small {
    font-size: 0.75rem;
    color: #697586;
    margin-left: 0.25rem;
}

.form-switch {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
}

.form-switch input {
    width: 1.25rem;
    height: 1.25rem;
}

.form-actions {
    display: flex;
    gap: 0.75rem;
}

.primary-button {
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #2563eb 0%, #0ea5e9 60%, #22d3ee 100%);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.1s ease-in, box-shadow 0.1s ease-in;
}

.primary-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(31, 97, 242, 0.2);
}

.ghost-button {
    padding: 0.75rem 1.3rem;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.5);
    background: rgba(255, 255, 255, 0.06);
    font-size: 0.95rem;
    font-weight: 500;
    color: #e2e8f0;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.ghost-button:hover {
    background: rgba(255, 255, 255, 0.12);
}

.card .ghost-button {
    background: #ffffff;
    color: var(--text);
    border: 1px solid #d2d6dc;
}

.card .ghost-button:hover {
    background: #f4f6fa;
}

.public-layout .ghost-button {
    pointer-events: auto;
}

.public-layout .ghost-button {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.25);
    color: #e2e8f0;
}

.public-layout .ghost-button:hover {
    background: rgba(255, 255, 255, 0.12);
}

.users-list-card {
    grid-column: span 1;
}

.users-header {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.user-filter {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.filter-row {
    display: flex;
    gap: 0.75rem;
}

.filter-row input[type="search"] {
    flex: 1;
    padding: 0.7rem 0.9rem;
    border: 1px solid #d2d6dc;
    border-radius: 10px;
}

.switch {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.switch input {
    width: 1.15rem;
    height: 1.15rem;
}

.users-table-wrapper {
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: 16px;
}

.users-table tbody tr.inactive {
    opacity: 0.65;
}

.user-cell {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.user-email {
    font-size: 0.85rem;
    color: #64748b;
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.35rem 0.8rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge-success {
    background: #dcfce7;
    color: #166534;
}

.badge-muted {
    background: #e2e8f0;
    color: #475569;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.users-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

.link-button {
    background: none;
    border: none;
    padding: 0.25rem 0.6rem;
    font-size: 0.9rem;
    color: #2563eb;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.15s ease;
}

.link-button:hover {
    background: rgba(37, 99, 235, 0.1);
}

.link-button.warning {
    color: #c2410c;
}

.link-button.warning:hover {
    background: rgba(194, 65, 12, 0.12);
}

.link-button.success {
    color: #047857;
}

.link-button.success:hover {
    background: rgba(4, 120, 87, 0.12);
}

.products-grid {
    display: grid;
    grid-template-columns: minmax(300px, 360px) 1fr;
    gap: 1.5rem;
    align-items: flex-start;
}

.product-form-card {
    position: sticky;
    top: 2rem;
}

.product-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.product-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.product-form input[type="text"],
.product-form input[type="number"],
.product-form textarea,
.product-form select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d2d6dc;
    border-radius: 10px;
    font-size: 0.95rem;
    box-sizing: border-box;
}

.product-form textarea {
    resize: vertical;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
}

.products-list-card {
    grid-column: span 1;
}

.products-header {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.product-filter {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.product-filter select {
    padding: 0.65rem 0.9rem;
    border: 1px solid #d2d6dc;
    border-radius: 10px;
    background: #ffffff;
}

.products-table-wrapper {
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: 16px;
}

.product-cell {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.products-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

.store-card {
    width: 100%;
}

.store-hero {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    padding: 2rem 0 1rem;
    align-items: center;
}

.hero-content h1 {
    font-size: clamp(2rem, 4vw, 2.8rem);
    margin: 0.35rem 0;
    color: #f8fafc;
}

.hero-subtitle {
    color: #cbd5e1;
    font-size: 1.05rem;
    max-width: 520px;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin: 1.25rem 0;
}

.hero-badges {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.hero-visual {
    position: relative;
    display: grid;
    place-items: center;
}

.hero-card {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(14, 165, 233, 0.18));
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.35);
    border-radius: 20px;
    padding: 1.5rem;
    backdrop-filter: blur(6px);
    color: #e2e8f0;
    max-width: 340px;
    width: 100%;
}

.hero-card h3 {
    margin: 0.25rem 0;
    color: #f8fafc;
}

.hero-price {
    font-size: 1.6rem;
    font-weight: 700;
    margin: 0.5rem 0 0.75rem;
}

.hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    color: #cbd5e1;
}

.hero-meta span {
    background: rgba(255, 255, 255, 0.06);
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    font-size: 0.88rem;
}

.hero-gradient {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 30% 30%, rgba(59, 130, 246, 0.2), transparent 45%), radial-gradient(circle at 80% 30%, rgba(34, 197, 94, 0.2), transparent 40%);
    filter: blur(40px);
    z-index: -1;
}

.store-shell {
    display: grid;
    grid-template-columns: 2fr 0.9fr;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.store-main {
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.04);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
    border-radius: 18px;
    padding: 1.5rem;
    color: #e2e8f0;
}

.store-main h2 {
    margin: 0.2rem 0;
    color: #f8fafc;
}

.store-main .muted {
    color: #94a3b8;
}

.store-main input,
.store-main select {
    background: rgba(15, 23, 42, 0.9);
    color: #e2e8f0;
    border: 1px solid rgba(148, 163, 184, 0.4);
}

.store-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.store-filter {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.store-filter input[type="search"] {
    padding: 0.7rem 0.9rem;
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 10px;
    min-width: 220px;
    background: rgba(15, 23, 42, 0.9);
    color: #e2e8f0;
}

.store-filter select {
    padding: 0.65rem 0.9rem;
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.9);
    color: #e2e8f0;
}

.store-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
}

.product-card {
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 16px;
    padding: 1.1rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    background: linear-gradient(145deg, rgba(15, 23, 42, 0.8), rgba(30, 41, 59, 0.9));
    color: #e2e8f0;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.25);
}

.product-card h3 {
    margin: 0;
}

.product-category {
    margin: 0;
    font-weight: 600;
    color: #60a5fa;
    letter-spacing: -0.01em;
}

.product-description {
    margin: 0;
    color: #cbd5e1;
    min-height: 48px;
}

.product-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.product-price {
    font-weight: 700;
    font-size: 1.15rem;
}

.product-actions {
    display: flex;
    gap: 0.5rem;
}

.pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    font-size: 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
    background: rgba(255, 255, 255, 0.05);
}

.pill-success {
    border-color: rgba(74, 222, 128, 0.35);
    background: rgba(22, 163, 74, 0.1);
    color: #bbf7d0;
}

.pill-warning {
    border-color: rgba(251, 191, 36, 0.35);
    background: rgba(250, 204, 21, 0.08);
    color: #fef08a;
}

.pill-muted {
    border-color: rgba(148, 163, 184, 0.35);
    color: #e2e8f0;
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.78rem;
    color: #94a3b8;
    margin: 0;
}

.cart-panel {
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
    border-radius: 18px;
    padding: 1.25rem;
    position: sticky;
    top: 1rem;
    height: fit-content;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.cart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cart-pill {
    padding: 0.35rem 0.8rem;
    border-radius: 999px;
    background: rgba(59, 130, 246, 0.15);
    color: #cbd5e1;
    font-weight: 600;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.cart-items {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.cart-item {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.5rem;
    padding: 0.85rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(148, 163, 184, 0.15);
}

.cart-item h4 {
    margin: 0 0 0.35rem;
    color: #e2e8f0;
}

.cart-item small {
    color: #94a3b8;
}

.cart-item .qty-controls {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: rgba(255, 255, 255, 0.04);
    padding: 0.35rem 0.5rem;
    border-radius: 999px;
}

.cart-item button {
    background: none;
    border: none;
    color: #cbd5e1;
    cursor: pointer;
    font-weight: 700;
}

.cart-summary {
    border-top: 1px solid rgba(148, 163, 184, 0.2);
    padding-top: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.summary-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.summary-note {
    font-size: 0.85rem;
    color: #94a3b8;
    margin: 0;
}

[data-cart-toggle] {
    border-color: rgba(255, 255, 255, 0.35);
    color: #e2e8f0;
}

[data-cart-toggle]:hover {
    background: rgba(255, 255, 255, 0.08);
}

.cart-panel-highlight {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.35), 0 20px 50px rgba(0, 0, 0, 0.35);
    transition: box-shadow 0.3s ease;
}

@media (max-width: 960px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 240px;
        padding: 2rem 1.5rem;
        transform: translateX(-100%);
        box-shadow: 20px 0 45px rgba(10, 14, 28, 0.45);
        z-index: 1000;
        justify-content: flex-start;
    }

    .sidebar.sidebar-open {
        transform: translateX(0);
    }

    .layout-body {
        display: block;
        overflow-x: hidden;
    }

    .sidebar-nav {
        width: 100%;
        flex-direction: column;
        gap: 0.75rem;
    }

    .layout-main {
        width: 100%;
        margin-left: 0;
        min-height: 100vh;
    }

    .sidebar-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 2.5rem;
        height: 2.5rem;
        border-radius: 999px;
        background: #e5edff;
    }

    .topbar {
        position: sticky;
        top: 0;
        z-index: 900;
        padding: 1rem 1.5rem;
    }

    .topbar-right {
        display: flex;
        align-items: center;
        gap: 1rem;
    }

    .layout-content {
        padding: 2rem 1.5rem;
        display: block;
    }

    .users-grid {
        display: flex;
        flex-direction: column;
        gap: 1.5rem;
    }

    .user-form-card {
        position: static;
    }

    .products-grid {
        display: flex;
        flex-direction: column;
        gap: 1.5rem;
    }

    .product-form-card {
        position: static;
    }

    .store-filter {
        width: 100%;
    }

    .store-shell {
        grid-template-columns: 1fr;
    }

    .cart-panel {
        position: static;
    }
}

@media (max-width: 600px) {
    .topbar-left h1 {
        font-size: 1.25rem;
    }

    .topbar-right {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .layout-content {
        padding: 1.5rem 1rem;
    }

    .card {
        margin-bottom: 1rem;
    }

    .filter-row {
        flex-direction: column;
    }

    .filter-row input[type="search"] {
        width: 100%;
    }

    .store-hero {
        padding-top: 1rem;
    }
}

/* Product Images Management */
.product-images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
    min-height: 60px;
}

.product-image-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid var(--border);
    background: var(--panel);
    cursor: move;
    transition: all 0.2s ease;
}

.product-image-item:hover {
    border-color: var(--accent);
    transform: scale(1.02);
}

.product-image-item.dragging {
    opacity: 0.5;
}

.product-image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-image-item .image-order-badge {
    position: absolute;
    top: 4px;
    left: 4px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.product-image-item .image-delete-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(220, 38, 38, 0.9);
    color: white;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    line-height: 1;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.product-image-item:hover .image-delete-btn {
    opacity: 1;
}

.product-image-item .image-delete-btn:hover {
    background: rgba(185, 28, 28, 1);
}

.image-upload-area {
    text-align: center;
    padding: 1rem;
    border: 2px dashed var(--border);
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.3);
}

.image-upload-area .muted.small {
    margin-top: 0.5rem;
    font-size: 0.75rem;
}

.product-images-empty {
    text-align: center;
    padding: 2rem;
    color: var(--muted);
    font-size: 0.9rem;
}

/* Store Products with Images */
.store-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    padding: 1rem 0;
}

.product-card {
    background: var(--card);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    border: 1px solid var(--border);
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
    border-color: var(--accent);
}

.product-image {
    position: relative;
    width: 100%;
    aspect-ratio: 4/3;
    overflow: hidden;
    background: linear-gradient(135deg, #f0f4f8 0%, #e2e8f0 100%);
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.product-image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(34, 211, 238, 0.1) 100%);
}

.placeholder-icon {
    font-size: 3rem;
    opacity: 0.5;
}

.product-badge {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    backdrop-filter: blur(8px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.badge-unavailable {
    background: rgba(239, 68, 68, 0.9);
    color: white;
}

.badge-low-stock {
    background: rgba(251, 191, 36, 0.9);
    color: #78350f;
}

.product-content {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.product-header {
    margin-bottom: 0.75rem;
}

.product-category {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--accent);
    font-weight: 600;
    margin: 0 0 0.375rem 0;
}

.product-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0 0 0.25rem 0;
    color: var(--text);
    line-height: 1.3;
}

.product-description {
    font-size: 0.875rem;
    color: var(--muted);
    line-height: 1.5;
    margin: 0 0 1rem 0;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-footer {
    margin-top: auto;
}

.product-pricing {
    margin-bottom: 1rem;
}

.product-price {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.25rem;
}

.product-actions {
    display: flex;
    gap: 0.5rem;
}

.product-actions .primary-button {
    flex: 1;
    justify-content: center;
    padding: 0.75rem;
    font-size: 0.9375rem;
}

.product-actions .primary-button:disabled {
    background: var(--muted);
    cursor: not-allowed;
    opacity: 0.5;
}

/* Empty State */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem 1rem;
}

.empty-state .muted {
    font-size: 1.125rem;
}

/* Responsive */
@media (max-width: 768px) {
    .store-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 1rem;
    }

    .product-card {
        border-radius: 8px;
    }

    .product-content {
        padding: 1rem;
    }

    .product-title {
        font-size: 1rem;
    }

    .product-price {
        font-size: 1.25rem;
    }
}

/* Destaque para seção de imagens após criar produto */
.form-group-images {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.05), rgba(34, 211, 238, 0.05));
    padding: 1.25rem;
    border-radius: 8px;
    border: 1px solid rgba(59, 130, 246, 0.2);
    animation: fadeInSection 0.5s ease-out;
}

@keyframes fadeInSection {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-group-images label {
    color: var(--accent);
    font-weight: 600;
}

.image-upload-area {
    transition: all 0.3s ease;
}

.image-upload-area:hover {
    border-color: var(--accent);
    background: rgba(59, 130, 246, 0.08);
}

/* =============================================== */
/* ============== Carrinho de Compras ============== */
/* =============================================== */

.cart-panel {
    background: linear-gradient(160deg, #131c31, #0d1425);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
}

.cart-header h3 {
    margin: 0;
    color: #f8fafc;
}

.cart-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 0.85rem;
    align-items: center;
    border-radius: 14px;
    padding: 0.75rem;
    transition: background 0.2s ease-out;
}

.cart-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.item-image {
    width: 60px;
    height: 60px;
    border-radius: 10px;
    overflow: hidden;
    background: #1e293b;
}

.item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.item-image .placeholder-icon {
    font-size: 1.5rem;
    display: grid;
    place-content: center;
    height: 100%;
    color: #94a3b8;
}

.item-details {
    line-height: 1.3;
}

.item-name {
    margin: 0;
    font-weight: 600;
    color: #e2e8f0;
}

.item-price {
    margin: 0;
    font-size: 0.9rem;
    color: #94a3b8;
}

.item-quantity-form {
    margin-top: 0.35rem;
}

.item-quantity-input {
    width: 55px;
    padding: 0.3rem 0.5rem;
    border-radius: 8px;
    border: 1px solid rgba(148, 163, 184, 0.4);
    background: rgba(15, 23, 42, 0.9);
    color: #e2e8f0;
    text-align: center;
    -moz-appearance: textfield;
}

.item-quantity-input::-webkit-outer-spin-button,
.item-quantity-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.remove-button {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.2rem 0.6rem;
    border-radius: 8px;
    transition: color 0.2s ease, background 0.2s ease;
}

.remove-button:hover {
    color: #f8fafc;
    background: rgba(239, 68, 68, 0.2);
}

.cart-summary .primary-button:disabled {
    background: #334155;
    color: #94a3b8;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

#hero-cart-button {
    min-width: 150px;
    text-align: center;
}

/* Indicador de carregamento HTMX */
.htmx-request .htmx-indicator {
    display: inline-block;
    opacity: 1;
}
.htmx-indicator {
    display: none;
    opacity: 0;
    transition: opacity 200ms ease-in;
}

.htmx-request.htmx-indicator-container .primary-button {
    pointer-events: none;
    background: var(--muted);
}

@media (max-width: 960px) {
    .store-shell {
        grid-template-columns: 1fr;
    }

    .cart-panel {
        position: static;
        margin-top: 1.5rem;
    }
}
