@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;600;700;800&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;1,9..40,300&display=swap');


:root {
    --bg: #F4F4F4;
    --surface: #F4F4F4;
    --surface2: #F4F4F4;
    --border: #2a3330;
    --accent: #3ddc84;
    --accent-dim: #2ab86a;
    --accent-glow: rgba(61, 220, 132, 0.15);
    --danger: #ff5c5c;
    --warn: #f5a623;
    --text: #000000;
    --text-muted: #6b8278;
    --radius: 10px;
    --font-head: 'Syne', sans-serif;
    --font-body: 'Syne', sans-serif;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

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

html {
    scroll-behavior: smooth;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.6;
    min-height: 100vh;
}

nav,
.navbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(8px);
}

ul,
li {
    list-style: none;
    display: inline-block;
}

nav .brand,
.navbar .brand {
    font-family: var(--font-head);
    font-weight: 800;
    font-size: 1.2rem;
    color: var(--accent);
    letter-spacing: -0.5px;
    text-decoration: none;
}

nav a,
.navbar a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.4rem 0.9rem;
    border-radius: 6px;
    transition: all 0.2s;
}

nav a:hover,
.navbar a:hover {
    color: var(--text);
    background: var(--surface2);
}

nav a.active,
.navbar a.active {
    color: var(--accent);
    background: var(--accent-glow);
}

.nav-links {
    display: flex;
    gap: 0.25rem;
    align-items: center;
}

.btn-logout {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted) !important;
    margin-left: 1rem;
}

.btn-logout:hover {
    border-color: var(--danger);
    color: var(--danger) !important;
    background: rgba(255, 92, 92, 0.08) !important;
}


.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 2.5rem 2rem;
}


h1 {
    font-family: var(--font-head);
    font-size: 2rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -1px;
    margin-bottom: 0.25rem;
}

h2 {
    font-family: var(--font-head);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 1.25rem;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: color 0.2s;
    margin-bottom: 1.5rem;
    display: inline-block;
}

.back-link:hover {
    color: var(--accent);
}

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    margin-top: 2rem;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.75rem;
    transition: all 0.25s;
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent);
    opacity: 0;
    transition: opacity 0.25s;
}

.card:hover {
    border-color: var(--accent);
    transform: translateY(-3px);
    box-shadow: 0 8px 32px rgba(61, 220, 132, 0.1);
}

.card:hover::before {
    opacity: 1;
}

.card h3 {
    font-family: var(--font-head);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.card p {
    font-family: var(--font-head);
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--accent);
    line-height: 1;
    margin-bottom: 1.25rem;
}

.card a {
    display: inline-block;
    background: var(--accent-glow);
    color: var(--accent);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    border: 1px solid rgba(61, 220, 132, 0.3);
    transition: all 0.2s;
}

.card a:hover {
    background: var(--accent);
    color: var(--bg);
}

.form-section,
.table-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.75rem;
    margin-bottom: 1.5rem;
}

.form-table-layout {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 1.5rem;
    align-items: start;
}

@media (max-width: 900px) {
    .form-table-layout {
        grid-template-columns: 1fr;
    }
}


form div {
    margin-bottom: 1rem;
}

label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
}

input[type="text"],
input[type="number"],
input[type="date"],
input[type="email"],
input[type="password"],
textarea,
select {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 7px;
    color: var(--text);
    font-family: var(--font-body);
    font-size: 0.95rem;
    padding: 0.65rem 0.9rem;
    transition: all 0.2s;
    outline: none;
    -webkit-appearance: none;
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

textarea {
    resize: vertical;
    min-height: 90px;
}

select option {
    background: var(--surface2);
    color: var(--text);
}


button[type="submit"],
.btn {
    background: var(--accent);
    color: var(--bg);
    border: none;
    border-radius: 7px;
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 700;
    padding: 0.7rem 1.5rem;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
    margin-top: 0.5rem;
    letter-spacing: 0.3px;
}

button[type="submit"]:hover,
.btn:hover {
    background: var(--accent-dim);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(61, 220, 132, 0.3);
}

.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
    width: auto;
    margin-top: 0;
}

.btn-danger {
    background: transparent;
    color: var(--danger);
    border: 1px solid var(--danger);
}

.btn-danger:hover {
    background: var(--danger);
    color: #fff;
    box-shadow: 0 4px 16px rgba(255, 92, 92, 0.3);
}


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

thead tr {
    border-bottom: 2px solid var(--border);
}

th {
    font-family: var(--font-head);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    padding: 0.75rem 1rem;
    text-align: left;
}

td {
    padding: 0.9rem 1rem;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    vertical-align: middle;
}

tbody tr {
    transition: background 0.15s;
}

tbody tr:hover {
    background: var(--surface2);
}

tbody tr:last-child td {
    border-bottom: none;
}

td a {
    color: var(--danger);
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 0.3rem 0.7rem;
    border: 1px solid var(--danger);
    border-radius: 5px;
    transition: all 0.2s;
}

td a:hover {
    background: var(--danger);
    color: #fff;
}

td img {
    border-radius: 6px;
    object-fit: cover;
    border: 1px solid var(--border);
}


.badge {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-active {
    background: rgba(61, 220, 132, 0.15);
    color: var(--accent);
    border: 1px solid rgba(61, 220, 132, 0.3);
}

.badge-expired {
    background: rgba(255, 92, 92, 0.1);
    color: var(--danger);
    border: 1px solid rgba(255, 92, 92, 0.2);
}

.badge-role {
    background: var(--surface2);
    color: var(--text-muted);
    border: 1px solid var(--border);
    margin-right: 4px;
}

.badge-role.superadmin {
    background: rgba(245, 166, 35, 0.1);
    color: var(--warn);
    border-color: rgba(245, 166, 35, 0.3);
}

.badge-role.admin {
    background: var(--accent-glow);
    color: var(--accent);
    border-color: rgba(61, 220, 132, 0.3);
}

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


.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(61, 220, 132, 0.05) 0%, transparent 60%),
        var(--bg);
}

.login-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2.5rem;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow);
}

.login-box h1 {
    font-size: 1.6rem;
    margin-bottom: 0.25rem;
}

.login-box p.subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 2rem;
}

.login-box button[type="submit"] {
    margin-top: 1rem;
}

.login-logo {
    font-family: var(--font-head);
    font-size: 1rem;
    font-weight: 800;
    color: var(--accent);
    margin-bottom: 1.75rem;
    display: block;
}

.alert-error {
    background: rgba(255, 92, 92, 0.1);
    border: 1px solid rgba(255, 92, 92, 0.3);
    color: var(--danger);
    border-radius: 7px;
    padding: 0.7rem 1rem;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.alert-success {
    background: rgba(61, 220, 132, 0.1);
    border: 1px solid rgba(61, 220, 132, 0.3);
    color: var(--accent);
    border-radius: 7px;
    padding: 0.7rem 1rem;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}


::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}


@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.container {
    animation: fadeUp 0.4s ease both;
}

.card:nth-child(1) {
    animation: fadeUp 0.4s 0.05s ease both;
}

.card:nth-child(2) {
    animation: fadeUp 0.4s 0.10s ease both;
}

.card:nth-child(3) {
    animation: fadeUp 0.4s 0.15s ease both;
}

.card:nth-child(4) {
    animation: fadeUp 0.4s 0.20s ease both;
}

.navbar-search {
    display: flex;
    justify-content: center;
    /* centra horizontalmente */
    align-items: center;
    /* centra verticalmente */
    margin-top: 10px;
}

.search-input {
    width: 100%;
    max-width: 300px;
}

.navbar-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 2rem;
    background: #0d0f0e;
    border-bottom: 1px solid #2a3330;
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid #3ddc84;
    object-fit: cover;
}

.user-name {
    color: #e0e0e0;
    font-size: 0.9rem;
    font-weight: 500;
}

.btn-logout {
    color: #6b8278;
    font-size: 0.85rem;
    text-decoration: none;
    border: 1px solid #2a3330;
    padding: 0.3rem 0.75rem;
    border-radius: 6px;
    transition: all 0.2s;
}

.btn-logout:hover {
    border-color: #ff6b6b;
    color: #ff6b6b;
}

.navbar-auth {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.navbar-auth a {
    color: #6b8278;
    text-decoration: none;
    font-size: 0.9rem;
}

.btn-login {
    background: rgba(61, 220, 132, 0.12);
    color: #3ddc84 !important;
    border: 1px solid rgba(61, 220, 132, 0.3);
    padding: 0.35rem 0.85rem;
    border-radius: 7px;
    transition: all 0.2s;
}

.btn-login:hover {
    background: #3ddc84 !important;
    color: #0d0f0e !important;
}

.btn-carrito-panel {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    color: #333;
    padding: 0;
    font-family: var(--font-body);
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-carrito-panel:hover {
    color: #22c55e;
}

/* Overlay */
.carrito-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 999;
    transition: opacity 0.3s;
}

.carrito-overlay.activo {
    display: block;
}

/* Panel lateral */
.carrito-panel {
    position: fixed;
    top: 0;
    right: -480px;
    width: 100%;
    max-width: 480px;
    height: 100vh;
    background: #fff;
    z-index: 1000;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    transition: right 0.35s cubic-bezier(.4, 0, .2, 1);
}

.carrito-panel.activo {
    right: 0;
}

.carrito-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #f0f0f0;
    background: #fff;
}

.carrito-panel-header h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 700;
}

.carrito-panel-cerrar {
    background: none;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    color: #666;
    padding: 4px 8px;
    border-radius: 6px;
    line-height: 1;
}

.carrito-panel-cerrar:hover {
    background: #f0f0f0;
    color: #111;
}

.carrito-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
}

.carrito-panel-loading {
    text-align: center;
    color: #999;
    padding: 40px 0;
    font-size: 1rem;
}

/* Items dentro del panel */
.panel-item {
    display: flex;
    gap: 14px;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid #f5f5f5;
}

.panel-item img,
.panel-item .no-img-panel {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}

.no-img-panel {
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.panel-item-info {
    flex: 1;
    min-width: 0;
}

.panel-item-nombre {
    font-weight: 600;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.panel-item-super {
    font-size: 0.8rem;
    color: #999;
}

.panel-item-precio {
    font-size: 0.9rem;
    color: #555;
    margin-top: 4px;
}

.panel-item-cantidad {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
}

.panel-item-cantidad input {
    width: 50px;
    padding: 4px 6px;
    border: 1px solid #ddd;
    border-radius: 6px;
    text-align: center;
    font-size: 0.85rem;
}

.panel-btn-act {
    background: #f0f0f0;
    border: none;
    border-radius: 6px;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 0.85rem;
}

.panel-btn-elim {
    background: #fee2e2;
    color: #dc2626;
    border: none;
    border-radius: 6px;
    padding: 5px 8px;
    cursor: pointer;
    font-size: 0.8rem;
    white-space: nowrap;
}

.panel-vacio {
    text-align: center;
    color: #aaa;
    padding: 60px 0;
    font-size: 1rem;
}

.panel-footer {
    border-top: 2px solid #f0f0f0;
    padding: 20px 24px;
    background: #fff;
}

.panel-total {
    display: flex;
    justify-content: space-between;
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 16px;
}

.panel-total span {
    color: #22c55e;
}

.panel-acciones {
    display: flex;
    gap: 10px;
}

.panel-btn-vaciar {
    flex: 1;
    background: #fee2e2;
    color: #dc2626;
    border: none;
    border-radius: 8px;
    padding: 10px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
}

.panel-btn-pagar {
    flex: 2;
    background: #22c55e;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 700;
}

.panel-btn-pagar:hover {
    opacity: 0.9;
}

.panel-btn-vaciar:hover {
    background: #fecaca;
}

.ml-seccion {
    max-width: 1100px;
    margin: 48px auto 60px;
    padding: 0 24px;
}

.ml-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.ml-titulo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ml-logo {
    background: #ffe600;
    color: #333;
    font-weight: 900;
    font-size: 0.8rem;
    padding: 4px 10px;
    border-radius: 6px;
    letter-spacing: 0.5px;
}

.ml-titulo h2 {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0;
}

.ml-ver-mas {
    font-size: 0.875rem;
    color: var(--color-primary, #4CAF50);
    text-decoration: none;
    font-weight: 600;
}

.ml-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.ml-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.07);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none;
    color: inherit;
    display: block;
}

.ml-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.ml-img-wrap {
    position: relative;
    background: #f8f8f8;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 160px;
    overflow: hidden;
}

.ml-img-wrap img {
    width: 100%;
    height: 160px;
    object-fit: contain;
    padding: 8px;
}

.ml-badge-descuento {
    position: absolute;
    top: 8px;
    left: 8px;
    background: #ff4747;
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
}

.ml-info {
    padding: 12px 14px 16px;
}

.ml-nombre {
    font-size: 0.875rem;
    color: #333;
    line-height: 1.3;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ml-precio {
    font-size: 1.1rem;
    font-weight: 700;
    color: #222;
}

.ml-precio-original {
    font-size: 0.8rem;
    color: #999;
    text-decoration: line-through;
    margin-top: 2px;
}

.ml-envio {
    font-size: 0.75rem;
    color: #00a650;
    font-weight: 600;
    margin-top: 6px;
}

.ml-vacio {
    text-align: center;
    padding: 40px;
    color: #888;
}

.navbar-logo {
    width: 120px;
    height: 50px;
    object-fit: contain;
}