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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f5f5;
    color: #333;
}

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

/* Header */
.site-header, .admin-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.site-header h1, .admin-header h1 {
    font-size: 28px;
    margin: 0;
}

.site-header nav a, .admin-header .admin-user a {
    color: white;
    text-decoration: none;
    margin-left: 20px;
}

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

.admin-user {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Login Page */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-box {
    background: white;
    border-radius: 10px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.login-box h2 {
    margin-bottom: 30px;
    text-align: center;
    color: #667eea;
}

.login-footer {
    margin-top: 20px;
    text-align: center;
}

.login-footer a {
    color: #667eea;
    text-decoration: none;
}

/* Alert */
.alert {
    padding: 12px 20px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.alert-error {
    background: #fee;
    color: #c33;
    border: 1px solid #fcc;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group input[type="file"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.form-group textarea {
    resize: vertical;
    font-family: inherit;
}

.form-group input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
}

.char-count {
    display: block;
    text-align: right;
    font-size: 12px;
    color: #888;
    margin-top: 5px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-small {
    padding: 8px 16px;
    font-size: 13px;
}

.btn-icon {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 5px 10px;
    transition: transform 0.2s;
}

.btn-icon:hover {
    transform: scale(1.2);
}

/* Shop Layout */
.shop-layout {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 30px;
    margin-top: 30px;
    margin-bottom: 100px;
}

.sidebar {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    height: fit-content;
    position: sticky;
    top: 20px;
}

.sidebar h3 {
    margin-bottom: 15px;
    color: #667eea;
}

.sidebar ul {
    list-style: none;
}

.sidebar ul li {
    margin-bottom: 10px;
}

.sidebar ul li a {
    display: block;
    padding: 10px;
    color: #555;
    text-decoration: none;
    border-radius: 5px;
    transition: all 0.3s;
}

.sidebar ul li a:hover,
.sidebar ul li a.active {
    background: #667eea;
    color: white;
}

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

.product-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: transform 0.3s, box-shadow 0.3s;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.product-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: #f0f0f0;
}

.product-info {
    padding: 15px;
}

.product-info h3 {
    margin-bottom: 8px;
    font-size: 18px;
    color: #333;
}

.product-info .product-category {
    font-size: 12px;
    color: #888;
    margin-bottom: 8px;
}

.product-info .product-description {
    font-size: 13px;
    color: #666;
    margin-bottom: 12px;
    line-height: 1.4;
}

.product-info .product-price {
    font-size: 24px;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 15px;
}

.product-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.quantity-spinner {
    display: flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 5px;
    overflow: hidden;
}

.quantity-spinner button {
    background: #f5f5f5;
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.3s;
}

.quantity-spinner button:hover {
    background: #e0e0e0;
}

.quantity-spinner input {
    width: 50px;
    text-align: center;
    border: none;
    padding: 8px 5px;
    font-size: 14px;
}

.product-actions .btn {
    flex: 1;
    text-align: center;
}

/* Cart Float Button */
.cart-float-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 50px;
    padding: 15px 25px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s;
    z-index: 100;
}

.cart-float-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.5);
}

.cart-icon {
    font-size: 24px;
}

.cart-count {
    background: #ff4757;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    animation: fadeIn 0.3s;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 10px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s;
}

.cart-modal-content {
    max-width: 700px;
}

.sabores-modal-content {
    max-width: 500px;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    color: #667eea;
}

.close-btn {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #999;
    line-height: 1;
    transition: color 0.3s;
}

.close-btn:hover {
    color: #333;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Cart Items */
.cart-items {
    margin-bottom: 20px;
}

.cart-item {
    display: flex;
    gap: 15px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
    margin-bottom: 10px;
}

.cart-item-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 5px;
    background: #e0e0e0;
}

.cart-item-info {
    flex: 1;
}

.cart-item-name {
    font-weight: 600;
    margin-bottom: 5px;
    color: #333;
}

.cart-item-sabores {
    font-size: 12px;
    color: #667eea;
    margin-bottom: 5px;
    font-style: italic;
}

.cart-item-price {
    color: #667eea;
    font-weight: 500;
}

.cart-item-actions {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-end;
}

.cart-item-quantity {
    display: flex;
    align-items: center;
    gap: 5px;
}

.cart-item-quantity button {
    background: #667eea;
    color: white;
    border: none;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.cart-item-quantity button:hover {
    background: #5568d3;
}

.cart-item-quantity span {
    min-width: 30px;
    text-align: center;
    font-weight: 600;
}

.cart-item-remove {
    background: #ff4757;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.3s;
}

.cart-item-remove:hover {
    background: #ff3838;
}

.cart-empty {
    text-align: center;
    padding: 40px;
    color: #999;
}

/* Cart Form */
.cart-form {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.cart-form h3 {
    margin-bottom: 15px;
    color: #667eea;
}

/* Cart Total */
.cart-total {
    background: #f0f0f0;
    padding: 15px;
    border-radius: 8px;
}

.total-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 16px;
}

.total-final {
    font-size: 20px;
    font-weight: bold;
    color: #667eea;
    padding-top: 10px;
    border-top: 2px solid #ddd;
}

/* Sabores Modal */
.sabores-producto-nombre {
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    color: #667eea;
    margin-bottom: 20px;
}

.sabores-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.sabor-item {
    display: flex;
    align-items: center;
    padding: 12px;
    background: #f9f9f9;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.sabor-item:hover {
    background: #f0f0f0;
}

.sabor-item.selected {
    background: #e8eaf6;
    border-color: #667eea;
}

.sabor-item input[type="checkbox"] {
    margin-right: 10px;
}

.sabor-item label {
    cursor: pointer;
    user-select: none;
    margin: 0;
    font-weight: normal;
}

/* Admin Page */
.admin-content {
    margin-top: 30px;
    background: white;
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.admin-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 2px solid #eee;
}

.tab-btn {
    padding: 12px 24px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 15px;
    color: #666;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
}

.tab-btn:hover {
    color: #667eea;
}

.tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-header h2 {
    color: #667eea;
}

.form-container {
    background: #f9f9f9;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 25px;
}

.form-container h3 {
    margin-bottom: 20px;
    color: #667eea;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

/* Table */
.table-container {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.data-table th {
    background: #f5f5f5;
    font-weight: 600;
    color: #667eea;
}

.data-table tr:hover {
    background: #f9f9f9;
}

.table-img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 5px;
}

.no-image {
    width: 60px;
    height: 60px;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: #999;
    border-radius: 5px;
}

.foto-preview {
    max-width: 200px;
    margin-top: 10px;
    border-radius: 5px;
}

.loading {
    text-align: center;
    padding: 60px;
    color: #999;
    font-size: 18px;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Responsive */
@media (max-width: 768px) {
    .shop-layout {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        position: static;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .cart-float-btn {
        bottom: 20px;
        right: 20px;
        padding: 12px 20px;
    }
    
    .sabores-grid {
        grid-template-columns: 1fr;
    }
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    animation: fadeIn 0.3s;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 10px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s;
}

.cart-modal-content {
    max-width: 700px;
}

.sabores-modal-content {
    max-width: 500px;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    color: #667eea;
}

.close-btn {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #999;
    line-height: 1;
    transition: color 0.3s;
}

.close-btn:hover {
    color: #333;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Cart Items */
.cart-items {
    margin-bottom: 20px;
}

.cart-item {
    display: flex;
    gap: 15px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
    margin-bottom: 10px;
}

.cart-item-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 5px;
    background: #e0e0e0;
}

.cart-item-info {
    flex: 1;
}

.cart-item-name {
    font-weight: 600;
    margin-bottom: 5px;
    color: #333;
}

.cart-item-sabores {
    font-size: 12px;
    color: #667eea;
    margin-bottom: 5px;
    font-style: italic;
}

.cart-item-price {
    color: #667eea;
    font-weight: 500;
}

.cart-item-actions {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-end;
}

.cart-item-quantity {
    display: flex;
    align-items: center;
    gap: 5px;
}

.cart-item-quantity button {
    background: #667eea;
    color: white;
    border: none;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.cart-item-quantity button:hover {
    background: #5568d3;
}

.cart-item-quantity span {
    min-width: 30px;
    text-align: center;
    font-weight: 600;
}

.cart-item-remove {
    background: #ff4757;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.3s;
}

.cart-item-remove:hover {
    background: #ff3838;
}

.cart-empty {
    text-align: center;
    padding: 40px;
    color: #999;
}

/* Cart Form */
.cart-form {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.cart-form h3 {
    margin-bottom: 15px;
    color: #667eea;
}

/* Cart Total */
.cart-total {
    background: #f0f0f0;
    padding: 15px;
    border-radius: 8px;
}

.total-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 16px;
}

.total-final {
    font-size: 20px;
    font-weight: bold;
    color: #667eea;
    padding-top: 10px;
    border-top: 2px solid #ddd;
}

/* Sabores Modal */
.sabores-producto-nombre {
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    color: #667eea;
    margin-bottom: 20px;
}

.sabores-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.sabor-item {
    display: flex;
    align-items: center;
    padding: 12px;
    background: #f9f9f9;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.sabor-item:hover {
    background: #f0f0f0;
}

.sabor-item.selected {
    background: #e8eaf6;
    border-color: #667eea;
}

.sabor-item input[type="checkbox"] {
    margin-right: 10px;
}

.sabor-item label {
    cursor: pointer;
    user-select: none;
    margin: 0;
    font-weight: normal;
}

/* Admin Page */
.admin-content {
    margin-top: 30px;
    background: white;
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.admin-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 2px solid #eee;
}

.tab-btn {
    padding: 12px 24px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 15px;
    color: #666;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
}

.tab-btn:hover {
    color: #667eea;
}

.tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-header h2 {
    color: #667eea;
}

.form-container {
    background: #f9f9f9;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 25px;
}

.form-container h3 {
    margin-bottom: 20px;
    color: #667eea;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

/* Table */
.table-container {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.data-table th {
    background: #f5f5f5;
    font-weight: 600;
    color: #667eea;
}

.data-table tr:hover {
    background: #f9f9f9;
}

.table-img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 5px;
}

.no-image {
    width: 60px;
    height: 60px;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: #999;
    border-radius: 5px;
}

.foto-preview {
    max-width: 200px;
    margin-top: 10px;
    border-radius: 5px;
}

.loading {
    text-align: center;
    padding: 60px;
    color: #999;
    font-size: 18px;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Responsive */
@media (max-width: 768px) {
    .shop-layout {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        position: static;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .cart-float-btn {
        bottom: 20px;
        right: 20px;
        padding: 12px 20px;
    }
    
    .sabores-grid {
        grid-template-columns: 1fr;
    }
}

/* ═══════════════════════════════════════════════
   PANEL PEDIDOS — agregar al final de styles.css
═══════════════════════════════════════════════ */

.hidden-mobile { display: inline; }

.panel-pedidos-wrap {
    padding-top: 20px;
    padding-bottom: 40px;
}

/* ── KPIs ── */
.kpi-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.kpi {
    background: #fff;
    border-radius: 10px;
    padding: 16px 12px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    cursor: pointer;
    transition: transform .15s, box-shadow .15s;
    border-top: 4px solid #ddd;
}
.kpi:hover { transform: translateY(-3px); box-shadow: 0 5px 16px rgba(0,0,0,0.12); }
.kpi-pendiente  { border-color: #f39c12; }
.kpi-prep       { border-color: #3498db; }
.kpi-listo      { border-color: #27ae60; }
.kpi-entregado  { border-color: #95a5a6; }
.kpi-total      { border-color: #667eea; cursor: default; }

.kpi-num   { font-size: 28px; font-weight: 700; color: #333; line-height: 1; }
.kpi-label { font-size: 12px; color: #666; margin-top: 4px; }

/* ── Filtros ── */
.panel-filtros {
    background: #fff;
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.filtros-fila {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: flex-end;
    margin-bottom: 10px;
}
.filtro-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.filtro-group label { font-size: 12px; font-weight: 600; color: #555; }
.filtro-group select,
.filtro-group input  { padding: 8px 10px; border: 1px solid #ddd; border-radius: 6px; font-size: 14px; }
.filtro-buscar { flex: 1; min-width: 160px; }
.filtro-buscar input { width: 100%; }

.filtros-acciones {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.auto-refresh-toggle {
    font-size: 13px;
    color: #555;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    margin-left: 4px;
}

/* ── Grid de tarjetas ── */
.pedidos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

/* ── Tarjeta pedido ── */
.pedido-card {
    background: #fff;
    border-radius: 10px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    border-left: 5px solid #ddd;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: box-shadow .2s;
}
.pedido-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.12); }

.estado-pendiente     { border-color: #f39c12; }
.estado-en_preparacion{ border-color: #3498db; }
.estado-listo         { border-color: #27ae60; }
.estado-entregado     { border-color: #95a5a6; }
.estado-cancelado     { border-color: #e74c3c; opacity: .7; }

.pc-header {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.pc-numero { font-size: 13px; font-weight: 700; color: #444; flex: 1; }
.pc-hora   { font-size: 12px; color: #888; }
.pc-badge  { color: #fff; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; white-space: nowrap; }

.pc-cliente { font-size: 15px; }
.pc-tel     { display: block; font-size: 13px; color: #667eea; text-decoration: none; margin-top: 2px; }
.pc-dir     { font-size: 13px; color: #666; }
.pc-obs     { font-size: 12px; color: #e67e22; background: #fff8f0; padding: 4px 8px; border-radius: 5px; }

.pc-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 4px;
    flex-wrap: wrap;
    gap: 8px;
}
.pc-total { display: flex; align-items: center; gap: 8px; font-size: 16px; }
.pc-acciones { display: flex; gap: 6px; flex-wrap: wrap; }

.badge { padding: 2px 8px; border-radius: 12px; font-size: 11px; font-weight: 600; }
.badge-efectivo { background: #e8f8f0; color: #27ae60; }
.badge-transf   { background: #eaf0fb; color: #2980b9; }

/* Botones de tarjeta */
.btn-ver, .btn-estado-next, .btn-cancelar {
    border: none; border-radius: 6px; cursor: pointer; font-size: 12px; padding: 6px 10px; font-weight: 600; transition: opacity .2s;
}
.btn-ver         { background: #eef0ff; color: #667eea; }
.btn-estado-next { background: #667eea; color: #fff; }
.btn-cancelar    { background: #fdecea; color: #e74c3c; }
.btn-ver:hover, .btn-estado-next:hover, .btn-cancelar:hover { opacity: .82; }

/* ── Modal detalle ── */
.modal-pedido-content { max-width: 640px; }

.md-seccion { margin-bottom: 16px; }
.md-titulo  { font-weight: 700; color: #667eea; margin-bottom: 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .5px; }

.md-fila {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}
.md-fila span:first-child { color: #888; }

.md-tabla { width: 100%; border-collapse: collapse; font-size: 13px; }
.md-tabla th { background: #f5f5f5; padding: 8px; text-align: left; color: #667eea; font-size: 12px; }
.md-tabla td { padding: 8px; border-bottom: 1px solid #f0f0f0; }

.md-totales { background: #fafafa; border-radius: 8px; padding: 12px; }
.md-total-final { font-size: 17px; font-weight: 700; color: #667eea; border-top: 2px solid #ddd; margin-top: 4px; padding-top: 8px; }

.btn-danger { background: #e74c3c; color: #fff; }
.btn-danger:hover { background: #c0392b; }

/* ── Responsive ── */
@media (max-width: 900px) {
    .kpi-row { grid-template-columns: repeat(3, 1fr); }
    .kpi-total { grid-column: span 3; }
}
@media (max-width: 600px) {
    .hidden-mobile { display: none; }
    .kpi-row { grid-template-columns: repeat(2, 1fr); }
    .kpi-total { grid-column: span 2; }
    .kpi-num  { font-size: 22px; }
    .pedidos-grid { grid-template-columns: 1fr; }
    .filtros-fila { flex-direction: column; }
    .filtro-group { width: 100%; }
    .filtro-group select,
    .filtro-group input { width: 100%; }
    .admin-header h1 { font-size: 20px; }
    .modal-pedido-content { max-width: 100%; border-radius: 10px 10px 0 0; align-self: flex-end; max-height: 92vh; }
}

/* Badges de rol en tabla usuarios */
.badge-admin  { background: #e8eaf6; color: #3949ab; padding: 3px 10px; border-radius: 12px; font-size: 12px; font-weight: 600; }
.badge-ventas { background: #e8f5e9; color: #2e7d32; padding: 3px 10px; border-radius: 12px; font-size: 12px; font-weight: 600; }

/* Badges de rol en tabla usuarios */
.badge-admin  { background: #e8eaf6; color: #3949ab; padding: 3px 10px; border-radius: 12px; font-size: 12px; font-weight: 600; }
.badge-ventas { background: #e8f5e9; color: #2e7d32; padding: 3px 10px; border-radius: 12px; font-size: 12px; font-weight: 600; }

/* Stock */
.stock-val      { font-weight: 700; color: #27ae60; }
.stock-bajo     { color: #e74c3c; }
/* Badges facturación */
.badge-sincobrar { background:#f0f0f0; color:#888; padding:3px 8px; border-radius:12px; font-size:11px; font-weight:600; }
.badge-ticketx   { background:#e8f5e9; color:#2e7d32; padding:3px 8px; border-radius:12px; font-size:11px; font-weight:600; }
.badge-afippend  { background:#fff8e1; color:#f57f17; padding:3px 8px; border-radius:12px; font-size:11px; font-weight:600; }
.badge-afipok    { background:#e3f2fd; color:#1565c0; padding:3px 8px; border-radius:12px; font-size:11px; font-weight:600; }

/* Botón cobrar */
.btn-cobrar { background:#27ae60; color:#fff; border:none; border-radius:6px; cursor:pointer; font-size:12px; padding:6px 10px; font-weight:600; }
.btn-cobrar:hover { opacity:.85; }

/* Botón reimprimir */
.btn-reimprimir { background:#f0f4ff; color:#667eea; border:none; border-radius:6px; cursor:pointer; font-size:14px; padding:6px 8px; }
.btn-reimprimir:hover { opacity:.85; }
.btn-reactivar { background:#eef0ff; color:#667eea; border:none; border-radius:6px; cursor:pointer; font-size:12px; padding:6px 10px; font-weight:600; }
.btn-reactivar:hover { opacity:.85; }

/* ═══════════════════════════════════════════════
   ADMIN HEADER — navbar nueva
═══════════════════════════════════════════════ */
.admin-header { padding: 0 !important; }

.adm-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    border-bottom: 1px solid rgba(255,255,255,0.15);
}
.adm-brand { display: flex; align-items: center; gap: 10px; }
.adm-brand-icon  { font-size: 22px; }
.adm-brand-title { font-size: 20px; font-weight: 700; color: #fff; }
.adm-user-area   { display: flex; align-items: center; gap: 14px; }
.adm-user-name   { color: rgba(255,255,255,0.88); font-size: 13px; font-weight: 500; }
.adm-btn-salir {
    background: rgba(255,255,255,0.18);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.35);
    border-radius: 6px;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: background .2s;
}
.adm-btn-salir:hover { background: rgba(255,255,255,0.30); }

/* Navbar desktop */
.adm-navbar { background: rgba(0,0,0,0.18); padding: 0 16px; }
.adm-nav-inner {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    scrollbar-width: none;
}
.adm-nav-inner::-webkit-scrollbar { display: none; }
.adm-nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 10px 18px;
    text-decoration: none;
    color: rgba(255,255,255,0.80);
    border-radius: 8px 8px 0 0;
    font-weight: 600;
    white-space: nowrap;
    transition: background .2s, color .2s;
    border-bottom: 3px solid transparent;
    min-width: 72px;
}
.adm-nav-btn:hover { background: rgba(255,255,255,0.14); color: #fff; }
.adm-nav-icon  { font-size: 18px; line-height: 1; }
.adm-nav-label { font-size: 11px; }
.adm-nav-pos:hover      { border-bottom-color: #a78bfa; }
.adm-nav-pedidos:hover  { border-bottom-color: #60a5fa; }
.adm-nav-ventas:hover   { border-bottom-color: #34d399; }
.adm-nav-caja:hover     { border-bottom-color: #fbbf24; }
.adm-nav-historial:hover{ border-bottom-color: #94a3b8; }
.adm-nav-stock:hover    { border-bottom-color: #f97316; }
.adm-nav-empresa:hover  { border-bottom-color: #f472b6; }

/* ── MOBILE ──────────────────────────────────── */
@media (max-width: 768px) {

    /* Header */
    .adm-topbar      { padding: 10px 16px; }
    .adm-brand-title { font-size: 17px; }
    .adm-user-name   { display: none; }

    /* Navbar: scroll horizontal simple, sin grid roto */
    .adm-navbar    { padding: 0 8px; }
    .adm-nav-inner { gap: 2px; }
    .adm-nav-btn   { padding: 8px 10px; min-width: 58px; }
    .adm-nav-icon  { font-size: 20px; }
    .adm-nav-label { font-size: 10px; }

    /* Tabs: scroll horizontal */
    .admin-content { padding: 14px 12px; margin-top: 12px; }
    .admin-tabs {
        overflow-x: auto;
        scrollbar-width: none;
        flex-wrap: nowrap;
        gap: 4px;
        padding-bottom: 2px;
        margin-bottom: 16px;
        border-bottom: 2px solid #eee;
    }
    .admin-tabs::-webkit-scrollbar { display: none; }
    .tab-btn {
        padding: 8px 14px;
        font-size: 13px;
        white-space: nowrap;
        flex-shrink: 0;
    }

    /* Section header */
    .section-header { flex-direction: column; align-items: flex-start; gap: 10px; }
    .section-header h2 { font-size: 18px; }
    .section-header .btn { width: 100%; text-align: center; }

    /* Formulario */
    .form-row { grid-template-columns: 1fr !important; }
    .form-container { padding: 14px 10px; }
    .form-actions { flex-direction: column-reverse; }
    .form-actions .btn { width: 100%; text-align: center; }

    /* Tabla → oculta en mobile */
    .art-desktop { display: none !important; }
    .art-mobile  { display: flex; flex-direction: column; gap: 8px; }
}

@media (min-width: 769px) {
    .art-desktop { display: block; }
    .art-mobile  { display: none; }
}

/* ── Tarjetas artículos (mobile) ── */
.art-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fff;
    border: 1px solid #ebebeb;
    border-radius: 10px;
    padding: 10px 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.art-card-foto {
    width: 50px; height: 50px;
    object-fit: cover; border-radius: 8px; flex-shrink: 0;
}
.art-card-nofoto {
    width: 50px; height: 50px;
    background: #f0f0f0; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; flex-shrink: 0;
}
.art-card-body { flex: 1; min-width: 0; }
.art-card-nombre {
    font-weight: 700; font-size: 14px; color: #222;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.art-card-meta { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 3px; }
.art-card-meta span {
    font-size: 11px; color: #888;
    background: #f5f5f5; padding: 1px 7px; border-radius: 10px;
}
.art-card-nums { display: flex; gap: 10px; align-items: center; margin-top: 5px; }
.art-card-precio { font-size: 15px; font-weight: 700; color: #667eea; }
.art-card-margen { font-size: 12px; font-weight: 600; }
.art-card-stock  { font-size: 12px; color: #555; }
.art-card-acciones { display: flex; flex-direction: column; gap: 0; flex-shrink: 0; }
.art-card-acciones .btn-icon { font-size: 19px; padding: 3px 5px; }

/* Tabs en mobile: grilla 3 columnas, sin scroll */
@media (max-width: 768px) {
    .admin-tabs {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr);
        overflow-x: visible !important;
        flex-wrap: unset;
        gap: 5px;
        border-bottom: none;
        margin-bottom: 16px;
    }
    .tab-btn {
        text-align: center;
        border: 1px solid #e0e4ff;
        border-radius: 8px;
        border-bottom: 1px solid #e0e4ff !important;
        background: #f5f6ff;
        padding: 8px 4px;
        font-size: 12px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .tab-btn.active {
        background: #667eea;
        color: #fff;
        border-color: #667eea !important;
    }
}

/* ═══════════════════════════════════════════════
   DRAWER MOBILE — admin.php
═══════════════════════════════════════════════ */

/* Hamburger — solo mobile */
.adm-hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 8px;
    cursor: pointer;
    padding: 6px;
}
.adm-hamburger span {
    display: block;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: .2s;
}

/* Overlay */
.adm-drawer-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 1000;
    backdrop-filter: blur(2px);
}
.adm-drawer-overlay.open { display: block; }

/* Drawer panel */
.adm-drawer {
    position: fixed;
    top: 0; left: -100%;
    width: 82%;
    max-width: 300px;
    height: 100vh;
    background: #fff;
    z-index: 1001;
    box-shadow: 4px 0 24px rgba(0,0,0,0.15);
    transition: left .25s ease;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}
.adm-drawer.open { left: 0; }

/* Drawer header */
.adm-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    flex-shrink: 0;
}
.adm-drawer-header button {
    background: rgba(255,255,255,0.2);
    border: none;
    color: #fff;
    font-size: 18px;
    width: 30px;
    height: 30px;
    border-radius: 6px;
    cursor: pointer;
    line-height: 1;
}

/* Secciones del drawer */
.adm-drawer-section { padding: 16px; border-bottom: 1px solid #f0f0f0; }
.adm-drawer-section:last-child { border-bottom: none; }
.adm-drawer-section-title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #aaa;
    margin-bottom: 10px;
}

/* Grid de módulos 2 columnas */
.adm-drawer-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.adm-drawer-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 8px;
    background: #f5f6ff;
    border: 1px solid #e0e4ff;
    border-radius: 10px;
    text-decoration: none;
    color: #444;
    font-size: 12px;
    font-weight: 600;
    transition: .15s;
}
.adm-drawer-item span:first-child { font-size: 22px; }
.adm-drawer-item:hover, .adm-drawer-item:active {
    background: #667eea;
    color: #fff;
    border-color: #667eea;
}

/* Lista de secciones (tabs) */
.adm-drawer-list { display: flex; flex-direction: column; gap: 4px; }
.adm-drawer-tab {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: none;
    border: none;
    border-radius: 8px;
    color: #444;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    transition: .15s;
}
.adm-drawer-tab:hover, .adm-drawer-tab:active {
    background: #f0f2ff;
    color: #667eea;
}

@media (max-width: 768px) {
    /* Mostrar hamburger, ocultar navbar desktop */
    .adm-hamburger { display: flex; }
    .adm-navbar     { display: none; }
    .adm-user-name  { display: none; }
    .adm-topbar     { padding: 10px 14px; }
    .adm-brand-title{ font-size: 16px; }

    /* Tabs en grid 3 columnas en mobile */
    .admin-tabs {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr);
        overflow-x: visible !important;
        gap: 5px;
        border-bottom: none;
        margin-bottom: 16px;
    }
    .tab-btn {
        text-align: center;
        border: 1px solid #e0e4ff !important;
        border-radius: 8px !important;
        background: #f5f6ff;
        padding: 8px 4px;
        font-size: 11px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .tab-btn.active {
        background: #667eea !important;
        color: #fff !important;
        border-color: #667eea !important;
    }
}

/* ── Fix tabs desktop: scroll horizontal si no entran ── */
@media (min-width: 769px) {
    .admin-tabs {
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        scrollbar-width: thin;
        gap: 4px;
        padding-bottom: 4px;
    }
    .admin-tabs::-webkit-scrollbar { height: 3px; }
    .admin-tabs::-webkit-scrollbar-track { background: #f0f0f0; }
    .admin-tabs::-webkit-scrollbar-thumb { background: #667eea; border-radius: 3px; }
    .tab-btn {
        white-space: nowrap;
        flex-shrink: 0;
    }
}

/* ── Fix mobile: ocultar tabs grid, mostrar solo el drawer ── */
@media (max-width: 768px) {
    /* Ocultar los tabs normales en mobile — se navega por drawer */
    .admin-tabs {
        display: none !important;
    }
}

/* Breadcrumb mobile sección activa */
.adm-mobile-breadcrumb {
    display: none;
}
@media (max-width: 768px) {
    .adm-mobile-breadcrumb {
        display: flex;
        align-items: center;
        justify-content: space-between;
        background: #f0f2ff;
        border: 1px solid #c5caff;
        border-radius: 8px;
        padding: 8px 12px;
        margin-bottom: 14px;
        font-size: 14px;
        font-weight: 700;
        color: #667eea;
    }
}

/* ── Fix scroll horizontal mobile ── */
@media (max-width: 768px) {
    html, body { overflow-x: hidden; max-width: 100vw; }
    .container  { padding: 0 10px; overflow-x: hidden; }
    .admin-content { overflow-x: hidden; padding: 12px 10px; }
    .section-header { flex-wrap: wrap; gap: 8px; }
    .section-header .btn { font-size: 12px; padding: 7px 10px; }
}

/* ── Fix tabs desktop: sin scrollbar visible ── */
@media (min-width: 769px) {
    .admin-tabs {
        scrollbar-width: none !important;
    }
    .admin-tabs::-webkit-scrollbar { display: none !important; }
}

/* ── Tabs desktop: 2 filas wrap, sin scroll ── */
@media (min-width: 769px) {
    .admin-tabs {
        display: flex !important;
        flex-wrap: wrap !important;
        overflow-x: visible !important;
        overflow-y: visible !important;
        scrollbar-width: none !important;
        gap: 6px !important;
        padding-bottom: 8px !important;
        border-bottom: 2px solid #eee !important;
        margin-bottom: 20px !important;
    }
    .admin-tabs::-webkit-scrollbar { display: none !important; }
    .tab-btn {
        white-space: nowrap;
        flex-shrink: 0;
        padding: 6px 14px !important;
        font-size: 13px !important;
        border-radius: 20px !important;
        border: 1px solid #e0e4ff !important;
        background: #f5f6ff !important;
        color: #555 !important;
        font-weight: 600;
        border-bottom: 1px solid #e0e4ff !important;
        transition: .15s;
    }
    .tab-btn:hover {
        background: #eef0ff !important;
        color: #667eea !important;
        border-color: #c5caff !important;
    }
    .tab-btn.active {
        background: #667eea !important;
        color: #fff !important;
        border-color: #667eea !important;
    }
}

/* Botones catálogo (Categorías / Sabores / Marcas) */
.btn-catalogo {
    background: #f0f2ff;
    color: #667eea;
    border: 1px solid #c5caff;
    border-radius: 7px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: .15s;
    white-space: nowrap;
}
.btn-catalogo:hover {
    background: #667eea;
    color: #fff;
    border-color: #667eea;
}

/* Botones cantidad mobile */
@media (max-width: 768px) {
    .quantity-spinner { overflow: visible !important; }
    .quantity-spinner button {
        padding: 10px 14px !important;
        font-size: 17px !important;
        min-width: 40px !important;
        -webkit-appearance: none;
    }
    .quantity-spinner input { width: 40px !important; }
    .product-actions { gap: 8px !important; }
    .product-actions .btn { font-size: 15px !important; padding: 10px 14px !important; }
}
