/* Digital/Youthful Theme - ADMIN / POS RESTORED */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;800&display=swap');

:root {
    /* Colors */
    --bg-body: #0a0a0a;
    --bg-card: #171717;
    --bg-sidebar: #121212;

    --primary: #ffffff;
    --text-muted: #a3a3a3;

    --accent: #3b82f6;
    --accent-glow: rgba(59, 130, 246, 0.5);

    --border: #262626;

    --success: #10b981;
    --danger: #ef4444;

    /* Typography */
    --font-sans: 'Outfit', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-body);
    color: var(--primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Navbar / Header */
.navbar {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--primary);
}

.nav-links {
    display: flex;
    gap: 1rem;
}

.nav-link {
    padding: 0.5rem 1rem;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.2s;
    cursor: pointer;
}

.nav-link:hover,
.nav-link.active {
    background: var(--accent);
    color: white;
}

/* Main Content Area */
.main-content {
    flex: 1;
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* Views (Tabs) - ESSENTIAL FOR ADMIN */
.view {
    display: none;
}

.view.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Products Grid (POS/Admin Version) */
.grid-products {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.2s;
    position: relative;
    /* Ensure containment */
}

/* Admin cards might be clickable or not, but usually just standard containers */
.card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.card-img-container {
    position: relative;
    padding-top: 100%;
    /* Square aspect ratio */
    overflow: hidden;
    width: 100%;
}

.card-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-body {
    padding: 1rem;
}

.card-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 1rem;
}

.card-price {
    color: var(--accent);
    font-weight: 800;
    font-size: 1.1rem;
}

/* Admin Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-card);
    width: 100%;
    max-width: 500px;
    border-radius: 16px;
    padding: 2rem;
    border: 1px solid var(--border);
    max-height: 90vh;
    overflow-y: auto;
}

/* Forms & Inputs */
input,
select,
textarea {
    width: 100%;
    padding: 0.75rem;
    background: var(--bg-body);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--primary);
    font-family: var(--font-sans);
    margin-bottom: 1rem;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent);
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--primary);
    font-size: 0.9rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    font-size: 0.9rem;
    width: 100%;
    /* Default to full width for admin forms often helpful, or auto */
}

.btn-primary {
    background: var(--primary);
    color: black;
}

.btn-primary:hover {
    background: #e5e5e5;
}

.btn-accent {
    background: var(--accent);
    color: white;
}

.btn-accent:hover {
    background: #2563eb;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--primary);
}

.btn-secondary:hover {
    border-color: var(--text-muted);
}

.btn-success {
    background: var(--success);
    color: white;
}

/* Tables */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

th,
td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.9rem;
}

/* KPI Grid */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Utilities */
.text-center {
    text-align: center;
}

.mt-4 {
    margin-top: 1rem;
}

.flex {
    display: flex;
    gap: 0.5rem;
}

.justify-between {
    justify-content: space-between;
}

/* Mobile Optimization */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        align-items: stretch;
        padding: 1rem;
        gap: 1rem;
    }

    .nav-links {
        overflow-x: auto;
        padding-bottom: 5px;
        -webkit-overflow-scrolling: touch;
    }

    .nav-link {
        white-space: nowrap;
        font-size: 0.9rem;
        padding: 0.5rem 0.8rem;
    }

    .main-content {
        padding: 1rem;
    }

    .grid-products {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    @media (max-width: 480px) {
        .grid-products {
            grid-template-columns: 1fr;
        }
    }

    .kpi-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .payment-actions {
        flex-direction: column;
    }
}

/* --- Responsive Cart Actions --- */
.cart-actions-container {
    margin-top: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border);
    padding-top: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.cart-buttons-group {
    display: flex;
    gap: 1rem;
}

.btn-whatsapp {
    background-color: #25D366;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
}

.btn-whatsapp:hover {
    transform: scale(1.05);
}

@media (max-width: 768px) {
    .cart-actions-container {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }

    .cart-total-info {
        margin-bottom: 0.5rem;
    }

    .cart-buttons-group {
        flex-direction: column;
        width: 100%;
    }

    .cart-buttons-group button {
        width: 100%;
        margin: 0 !important;
    }
}