.admin-wrapper {
    max-width: 960px;
    margin: 0 auto;
    padding: 1.5rem 1rem;
}

.admin-header {
    text-align: center;
    margin-bottom: 1.2rem;
}

.admin-header h2 { margin: 0 0 0.3rem; }
.admin-header p  { margin: 0; color: #999; font-size: 0.9rem; }

.admin-search-bar {
    margin-bottom: 1.2rem;
}

.admin-search-bar input {
    width: 100%;
    padding: 12px;
    border-radius: 10px;
    border: 1px solid var(--pink-light);
    box-sizing: border-box;
    font-size: 0.95rem;
}

/* Tabla estilo DataGrid */
.admin-grid {
    width: 100%;
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid var(--pink-light);
    box-shadow: 0 2px 10px rgba(225,155,157,0.1);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
    text-align: left;
    background: white;
}

.admin-table thead tr {
    background: var(--pink-accent);
    color: white;
}

.admin-table th {
    padding: 11px 14px;
    font-weight: bold;
    white-space: nowrap;
}

.admin-table td {
    padding: 6px 14px;
    border-bottom: 1px solid rgba(225,155,157,0.2);
    color: var(--brown-text);
    vertical-align: middle;
}

.admin-table tbody tr:last-child td { border-bottom: none; }
.admin-table tbody tr:hover { background: #fff5f5; }

.admin-td-estado {
    font-weight: bold;
    color: var(--pink-accent);
    white-space: nowrap;
}

.admin-td-guia {
    font-size: 0.75rem;
    color: #aaa;
    font-family: monospace;
}

.admin-btn-actualizar {
    background: var(--pink-accent);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 4px;
    min-height: 24px;
    min-width: 26px;
    font-size: 0.75rem;
    font-weight: bold;
    cursor: pointer;
    white-space: nowrap;
    transition: opacity 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.admin-btn-actualizar:hover { opacity: 0.85; }

.admin-btn-copiar {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    font-size: 0.75rem;
    font-family: monospace;
    color: #aaa;
    cursor: pointer;
    text-decoration: underline dotted;
    transition: color 0.15s;
}

.admin-btn-copiar:hover { color: var(--pink-accent); }

.admin-btn-back {
    background: none;
    border: 1px solid var(--pink-light);
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 0.85rem;
    cursor: pointer;
    color: var(--brown-text);
    display: block;
    margin-bottom: 0.5rem;
}

.admin-btn-back:hover { background: var(--pink-light); }

.admin-btn-agregar {
    background: var(--brown-text);
    color: white;
    border: none;
    border-radius: 20px;
    padding: 10px 20px;
    font-size: 0.88rem;
    font-weight: bold;
    cursor: pointer;
    white-space: nowrap;
    transition: opacity 0.2s;
}
.admin-btn-agregar:hover { opacity: 0.85; }

.store-admin-grid {
    width: 100%;
    margin-top: 1rem;
}

.store-name-cell {
    font-weight: 700;
    color: #4d342f;
    font-size: 0.96rem;
}

.store-token-cell {
    color: #7d5a57;
    font-family: monospace;
    font-size: 0.74rem;
    word-break: break-all;
}

.store-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 90px;
    padding: 0.32rem 0.55rem;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1;
    background: #f5e7e1;
    color: #7b5448;
}

.store-client-name {
    font-weight: 700;
    color: #4d342f;
    font-size: 0.94rem;
    line-height: 1.3;
}

.store-client-meta {
    display: block;
    margin-top: 0.18rem;
    color: #7d5a57;
    font-size: 0.7rem;
    letter-spacing: 0.02em;
}

.store-match-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 0.25rem;
    margin-bottom: 0.12rem;
    padding: 0.12rem 0.38rem;
    border-radius: 999px;
    font-size: 0.56rem;
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.store-match-badge.matched {
    background: #e8f7ee;
    color: #266c45;
}

.store-match-badge.unmatched {
    background: #f8e3e3;
    color: #9d4a4a;
}

.store-customer-items-compact {
    min-width: 0;
    max-width: 100%;
    min-height: 28px;
    max-height: 42px;
    overflow: hidden;
    color: #4d342f;
    font-size: 0.75rem;
    line-height: 1.1;
    white-space: normal;
    display: block;
    padding-top: 0.04rem;
    padding-bottom: 0.04rem;
}

.store-customer-item-action {
    min-width: 24px;
    min-height: 24px;
    background: #9dd9b4;
    padding: 4px 6px;
    font-size: 0.7rem;
}

.store-customer-new-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0.7rem 1rem;
    border: 1px solid #e7b9bf;
    border-radius: 12px;
    background: linear-gradient(180deg, #fff8f8 0%, #fdf1f2 100%);
    color: #5c3d34;
    font-size: 0.96rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(124, 80, 80, 0.08);
}

.store-customer-new-btn:hover {
    background: linear-gradient(180deg, #fff1f3 0%, #fbe7eb 100%);
    border-color: #d99ca7;
    transform: translateY(-1px);
}

.store-badge.draft { background: #f4e8e3; color: #7c5d52; }
.store-badge.active { background: #e8f7ee; color: #266c45; }
.store-badge.expired { background: #f8e3e3; color: #9d4a4a; }

/* Vistas de listado (Item de la tienda, Compras de la tienda): sin card blanca,
   igual que el grid principal de tiendas (fondo transparente). */
.store-items-detail-view {
    margin-top: 1rem;
}

/* Paneles de formulario (Cargar Item, Editar Item, Editar Tienda): mismo estilo
   transparente que "Editar Factura" (.container > .card), sin fondo blanco. */
.store-item-panel {
    background: transparent;
    border: 1px solid var(--pink-light);
    border-radius: 14px;
    padding: 1.25rem;
    margin-top: 1rem;
}

.store-item-detail-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
    position: relative;
    min-height: 42px;
}

.store-item-detail-header .admin-btn-back {
    position: absolute;
    left: 0;
}

.store-item-detail-title-wrap {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    font-weight: 800;
    color: #56392f;
}

.store-items-thumbnail {
    width: 54px;
    height: 54px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid rgba(116, 83, 71, 0.12);
    background: #fff;
}

.store-item-description {
    max-width: 260px;
    color: #5f3b2c;
}

.empty-state {
    background: rgba(255, 255, 255, 0.7);
    border: 1px dashed rgba(95, 59, 44, 0.3);
    border-radius: 14px;
    padding: 1.4rem;
    text-align: center;
    color: #7a5246;
}

.admin-search-bar {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 1.2rem;
}
.admin-search-bar input { flex: 1; margin-bottom: 0; }

.admin-filter-chips {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin: 0.75rem 0 1rem;
    color: var(--brown-text);
}

.admin-filter-option {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 0.8rem;
    border: 1px solid var(--pink-light);
    border-radius: 999px;
    background: #fff8f8;
    color: var(--brown-text);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.admin-filter-option:hover {
    border-color: var(--pink-accent);
    background: #fff2f3;
}

.admin-filter-option input {
    accent-color: var(--pink-accent);
    margin: 0;
}

/* Fila de filtros por columna */
.admin-filter-row { background: #fdf0f1 !important; }
.admin-filter-row td { padding: 6px 8px; }
.admin-filter-row input,
.admin-filter-row select {
    width: 100%;
    padding: 5px 8px;
    border: 1px solid #dfe3e8;
    border-radius: 6px;
    font-size: 0.78rem;
    box-sizing: border-box;
    background: white;
    color: var(--brown-text);
    min-height: 30px;
    box-shadow: none;
    outline: none;
}

.admin-filter-row select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: none;
    padding-right: 8px;
    cursor: pointer;
}

.admin-filter-row input:focus,
.admin-filter-row select:focus {
    border-color: var(--pink-accent);
    box-shadow: 0 0 0 2px rgba(225, 155, 157, 0.12);
}

.store-admin-status-filter {
    cursor: pointer;
}

/* Header ordenable */
.admin-table th.sortable { cursor: pointer; user-select: none; }
.admin-table th.sortable:hover { opacity: 0.85; }
.sort-arrow { font-size: 0.7rem; margin-left: 4px; opacity: 0.7; }

.admin-actions-cell {
    display: table-cell;
    vertical-align: middle;
    white-space: nowrap;
    text-align: right; 
}

.admin-btn-track {
    background: #f3bfc1;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 4px;
    min-height: 24px;
    min-width: 26px;
    font-size: 0.75rem;
    font-weight: bold;
    cursor: pointer;
    white-space: nowrap;
    transition: opacity 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 4px;
}

.admin-btn-track:hover { opacity: 0.85; }

/* Botón para editar la información completa de la fila */
.admin-btn-edit {
    background: #f3bfc1 !important; 
    color: white;
    border: none;
    border-radius: 6px;
    padding: 4px;
    min-height: 24px;
    min-width: 26px;
    font-size: 0.75rem;
    font-weight: bold;
    cursor: pointer;
    white-space: nowrap;
    transition: opacity 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 4px;
}

.admin-btn-edit:hover { opacity: 0.85; }

/* Botón para copiar el enlace de rastreo */
.admin-btn-copy-link {
    background: var(--brown-text);
    color: white;
    border: none;
    border-radius: 20px;
    padding: 6px 12px;
    min-height: 28px;
    font-size: 0.8rem;
    font-weight: bold;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    margin-right: 6px;
    min-width: 36px;
    justify-content: center;
}

.admin-btn-copy-link:hover { opacity: 0.85; transform: scale(1.05); }

    transform: rotate(45deg); opacity: 0; transition: opacity 0.2s;
}
.custom-checkbox-container input[type="checkbox"]:checked + .checkbox-label::after { opacity: 1; }

/* Estilo para botones de icono en formularios (Subir/Tomar foto) */
.admin-btn {
    background: var(--pink-light);
    border: none;
    border-radius: 12px;
    width: 40px;
    height: 40px;
    cursor: pointer;
    color: var(--pink-accent);
    font-size: 1rem;
    transition: background-color 0.2s;
}
.admin-btn:hover { background-color: #f3bfc1; color: white; }
